X = 0
Y = 380
Largura = 640
Altura = 100
class Hud < Window_Base
def initialize
super(X,Y,Largura,Altura)
self.contents = Bitmap.new(width - 32, height - 32)
@ator = 0
refresh
end
def refresh
self.contents.clear
actor = $game_party.actors[0]
#Conteúdo:
draw_face (actor, 80,80)
#draw_actor_hp_bar_1(actor, -30, 90)
#draw_actor_sp_bar_1(actor, -30, 110)
draw_actor_hp(actor, 120, 10, width = 144)
draw_actor_sp(actor, 260, 10, width = 144)
draw_actor_state(actor, 210, 38, width = 144)
#Fim
if $scene.is_a?(Scene_Menu)
self.contents.clear
end
if $scene.is_a?(Scene_Battle)
self.contents.clear
self.visible = false
end
end
end
#Adiciona a janela a o mapa.
class Scene_Map
alias hud_main main
def main
@Hud = Hud.new
hud_main
@Hud.dispose
end
alias hud_update update
def update
hud_update
@Hud.update
@Hud.refresh
end
end
class Window_Base < Window
def draw_face (actor, x, y)
bitmap = RPG::Cache.picture(actor.name + "_face")
cw = bitmap.width
ch = bitmap.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x -cw / 2 , y - ch,bitmap, src_rect)
end
def draw_actor_hp_bar_1(actor, x, y)
back = RPG::Cache.picture("Barra_Fundo")
cw = back.width
ch = back.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 30, back, src_rect)
meter = RPG::Cache.picture("Barra_Hp")
cw = meter.width * actor.hp / actor.maxhp
ch = meter.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 30, meter, src_rect)
end
def draw_actor_sp_bar_1(actor, x, y)
back = RPG::Cache.picture("Barra_Fundo")
cw = back.width
ch = back.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 30, back, src_rect)
meter = RPG::Cache.picture("Barra_Sp")
cw = meter.width * actor.sp / actor.maxsp
ch = meter.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 30, meter, src_rect)
end
end
Социальные закладки