[FBN]Simples HUD
Pra quem tem preguiça de fazer tá ai. Deu vontade de fazer =P
Acho que vou ver as SKILLS e dar uma modificada lá talvez pra ficar que nem do rag.
Pra quem tem preguiça de fazer tá ai. Deu vontade de fazer =P
Acho que vou ver as SKILLS e dar uma modificada lá talvez pra ficar que nem do rag.
Ela Contem:
> NOME
> LEVEL
> XP
> HP
> MP
> GOLD
> Vantagem de ocupar um pequeno espaço!
Script:
- Código:
#==============================================================================
# ** HUD
#------------------------------------------------------------------------------
# By Marlos Gama
# Modificado por Fabinhuu ;
#------------------------------------------------------------------------------
class Hud < Window_Base
def initialize
super(-16,-16,500,200)#(320,350,600,600)
self.back_opacity = 120
self.contents = Bitmap.new(width - 32, height - 32)
self.windowskin = RPG::Cache.windowskin("Blank")
refresh
end
def update
super
refresh if something_changed?
end
def something_changed?
return true if @old_exp != @actor.now_exp
return true if @old_hp != @actor.hp
return true if @old_sp != @actor.sp
return true if @old_level != @actor.level
return true if @old_name != @actor.name
return true if @old_name != @old_gold
return false
end
def refresh
self.contents.clear
@actor = $game_party.actors[0]
@old_exp = @actor.now_exp
@old_hp = @actor.hp
@old_sp = @actor.sp
@old_level = @actor.level
@old_name = @actor.name
@old_gold = $game_party.item_number(Item_Ouro::Item_Id.to_i).to_s
self.contents.clear
hud3 = RPG::Cache.picture("HudBase")
hud1 = hud3.width
hud2 = hud3.height
hud4 = Rect.new(0,0,hud1,hud2)
self.contents.blt(0,0,hud3,hud4)
self.contents.font.size = 16
rect = Rect.new(-172, -7, self.contents.width - 8, 32)
self.contents.font.color = Color.new(255,255,255)
self.contents.font.size = 14
self.contents.draw_text(rect, "#{@old_name}", 1)
self.contents.font.size = 16
self.contents.draw_text(8, 7, 132, 32, "#{@actor.level}")
rectc = Rect.new(75, 11+1, self.contents.width - 8, 32)
# Hp
self.contents.font.color = Color.new(255,255,255)
hpbar = RPG::Cache.picture("BarraHP")
hpbarwidth = hpbar.width * @actor.hp / @actor.maxhp
hpbarheight = hpbar.height
hpbar_rect = Rect.new(0,0,hpbarwidth,hpbarheight)
self.contents.blt(101,6,hpbar,hpbar_rect)
if $game_party.actors[0].level <= 21
self.contents.draw_text(155, -5, 132, 32, "#{@actor.hp}/#{@actor.maxhp}")
else
self.contents.draw_text(227, 28, 132, 32, "#{@actor.hp}/#{@actor.maxhp}")
end
# Sp
mpbar = RPG::Cache.picture("BarraMP")
mpbarwidth = mpbar.width * @actor.sp / @actor.maxsp
mpbarheight = mpbar.height
mpbar_rect = Rect.new(0,0,mpbarwidth,mpbarheight)
self.contents.blt(101,19,mpbar,mpbar_rect)
if $game_party.actors[0].level <= 34
self.contents.draw_text(155, 7, 132, 32, "#{@actor.sp}/#{@actor.maxsp}")
xpbar = RPG::Cache.picture("BarraxP")
xpbarwidth = xpbar.width * @actor.now_exp / @actor.next_exp
xpbarheight = xpbar.height
xpbar_rect = Rect.new(0,0,xpbarwidth,xpbarheight)
self.contents.blt(98,34,xpbar,xpbar_rect)
self.contents.draw_text(101, -5, 132, 32, "HP")
self.contents.draw_text(101, 7, 132, 32, "SP")
self.contents.font.size = 13
self.contents.draw_text(150, 26, 132, 32, "#{@actor.now_exp}/#{@actor.next_exp}")
#
#
if $game_party.item_number(Item_Ouro::Item_Id.to_i) > 999
self.contents.font.size = 14
self.contents.draw_text(55, 9, 132, 32, "#{@old_gold}")
else
self.contents.font.size = 16
self.contents.draw_text(55, 9, 132, 32, "#{@old_gold}")
end
#
end
end
end
##49 48
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
end
end
class Game_Actor < Game_Battler
def now_exp
return @exp - @exp_list[@level]
end
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
end
Adicione na pasta PICTURES sem as aspas ""
- Spoiler:
- Nome: "HudBase"
Nome: "BarraxP"
Nome: "BarraMP"
Nome: "BarraHP"