After a long time reading it, i finally think i Understood how to make a basic HUD.
But now I want to add some features, so I need your help.
Btw, I dont know how to make spoilers, or put my codes in the cool code thing, so I would appreciate help with that too.
Here's my code.
Basically copy and pasted, with slight modifications.
I wanted it justified to the top left, and I managed to do that.
Now I need help adding the character's name to it.
I know I'll be using \n[1], but idk where.
Since I can't have it on during battles and cutscenes and such, I need to be able to turn it off as well. Like, make it reliant on a switch or something.
I also want to add icons near the words HP and SP, like potion bottles or something.
Lastly, I want the current level to be displayed as well.
Any help would be greatly appreciated, and I'm sure this would help many of the n00bs like me trying to make custom HUDs
Thanks. :thumb:
But now I want to add some features, so I need your help.
Btw, I dont know how to make spoilers, or put my codes in the cool code thing, so I would appreciate help with that too.
Here's my code.
Basically copy and pasted, with slight modifications.
Code:
class Window_YourHUD < Window_Base
def initialize
super(0, 0, 350, 64)
self.contents = Bitmap.new(350 - 32, 64 - 32)
refresh
end
def refresh
self.contents.clear
reset_variables
return if !@actor
draw_actor_hp(@actor, 0, 0)
draw_actor_sp(@actor, 150, 0)
end
def reset_variables
@actor = $game_party.actors[0]
@old_hp = @actor ? @actor.hp : 0
@old_maxhp = @actor ? @actor.maxhp : 0
@old_sp = @actor ? @actor.sp : 0
@old_maxsp = @actor ? @actor.maxsp : 0
end
def update
super
refresh if (@actor = $game_party.actors[0] or
@old_hp = @actor ? @actor.hp : 0 or
@old_maxhp = @actor ? @actor.maxhp : 0 or
@old_sp = @actor ? @actor.sp : 0 or
@old_maxsp = @actor ? @actor.maxsp : 0)
end
end
class Scene_Map
alias yourhud_main main
alias yourhud_update update
def main
@yourhud = Window_YourHUD.new
yourhud_main
@yourhud.dispose
end
def update
@yourhud.update
yourhud_update
end
end
I wanted it justified to the top left, and I managed to do that.
Now I need help adding the character's name to it.
I know I'll be using \n[1], but idk where.
Since I can't have it on during battles and cutscenes and such, I need to be able to turn it off as well. Like, make it reliant on a switch or something.
I also want to add icons near the words HP and SP, like potion bottles or something.
Lastly, I want the current level to be displayed as well.
Any help would be greatly appreciated, and I'm sure this would help many of the n00bs like me trying to make custom HUDs
Thanks. :thumb: