creditos: PRASKURIN por criar e postar aqui
#############################################################
################### AllSidesGames ###########################
#############################################################
X = 0
Y = 0
Largura = 350
Altura = 200
class Hud < Window_Base
def initialize
super(X,Y,Largura,Altura)
self.contents = Bitmap.new(width - 32, height - 32)
@ator = 0
self.opacity = 0
refresh
end
def refresh
self.contents.clear
actor = $game_party.actors[0]
hud3 = RPG::Cache.picture("BASE")
hud1 = hud3.width
hud2 = hud3.height
hud4 = Rect.new(0,0,hud1,hud2)
self.contents.blt(0,0,hud3,hud4)
#===========================================================#
#====================== Segunda Parte =====================#
#===========================================================#
hpbar = RPG::Cache.picture("HP bar")
hpbarwidth = hpbar.width * actor.hp / actor.maxhp
hpbarheight = hpbar.height
hpbar_rect = Rect.new(0,0,hpbarwidth,hpbarheight)
self.contents.blt(25,10,hpbar,hpbar_rect)
hpbar = RPG::Cache.picture("MP bar")
hpbarwidth = hpbar.width * actor.sp / actor.maxsp
hpbarheight = hpbar.height
hpbar_rect = Rect.new(0,0,hpbarwidth,hpbarheight)
self.contents.blt(25,30,hpbar,hpbar_rect)
draw_actor_class(actor, 200, 0)
draw_actor_exp(actor, 170,20)
#===========================================================#
#====================== Terçeira Parte =====================#
#===========================================================#
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
#===========================================================#
#====================== Finalizando ========================#
#===========================================================#
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
pronto...
Nenhum comentário:
Postar um comentário