Olá pessoal,eu tinha pedido para fazerem uma HUD do Kingdom Heart,só que ninguém respondeu ao tópico e nisso eu procurei na web como fazer uma HUD,ai eu fiz e tá aqui!
Imagens:
Imagens utilizadas:
Imagens:
- Spoiler:
Imagens utilizadas:
- Spoiler:
- Código:
#=============================================================================#
#HUD do Kingdom Heart #
#Por Gabrielte #
#=============================================================================#
class HUD < Window_Base
def initialize
super(300, 360, 350, 150)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
@ator = 0
refresh
end
def refresh
self.contents.clear
heroi = $game_party.actors[0]
barrahp = RPG::Cache.picture("HP BAR")
barrahpw = barrahp.width * heroi.hp / heroi.maxhp
barrahph = barrahp.height
barrahp_rect = Rect.new(0, 0, barrahpw, barrahph)
self.contents.blt(+144, +25, barrahp, barrahp_rect)
barramp = RPG::Cache.picture("MP BAR")
barrampw = barramp.width * heroi.sp / heroi.maxsp
barramph = barramp.height
barramp_rect = Rect.new(0, 0, barrampw, barramph)
self.contents.blt(+143, +88, barramp, barramp_rect)
barraovd = RPG::Cache.picture("")
barraovdw = barraovd.width * $game_variables[1] / 100
barraovdh = barraovd.height
barraovd_rect = Rect.new(0, 0, barraovdw, barraovdh)
self.contents.blt(65, 28, barraovd, barraovd_rect)
hudbase = RPG::Cache.picture("KINGDOM HUD")
hudbasew = hudbase.width
hudbaseh = hudbase.height
hudbase_rect = Rect.new(0, 0, hudbasew, hudbaseh)
self.contents.blt(+140, +8, hudbase, hudbase_rect)
end
end
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