lukecovack
Member
I have this script that make a hud to display hp and sp but I need it to display it for all 4 characters
Code:
class Window_YourHUD < Window_Base
def initialize
super(0, 0, 155 , 85)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.size = 14
self.opacity = 0
refresh
end
def refresh
self.contents.clear
reset_variables
return if !@actor
draw_actor_name(@actor, 0, 0)
draw_actor_hp(@actor, 0, 15)
draw_actor_sp(@actor, 0, 30)
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
def main
@yourhud = Window_YourHUD.new
yourhud_main
@yourhud.dispose
end
end