por Maverick ~ Qui Mar 29, 2012 3:12 pm
Tá ae cara só ão coloquei o codigo do cash pq não uso cash aqui ai dava erro.
mais pelo visto ja conhece o comando e eu demarquei ond vc pode colocar
- Código:
#Creds:Leon Scott Kennedy.
#Mantenha os creditos
#Aldeia rpg BR
class Hud < Window_Base
def initialize
super(-10,-10,500,500)
self.back_opacity = 0
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 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
hud3 = RPG::Cache.picture("Base-2")
hud1 = hud3.width
hud2 = hud3.height
hud4 = Rect.new(0,0,hud1,hud2)
self.contents.blt(-13,-16,hud3,hud4)
fundo = RPG::Cache.picture("Base")
fundowidth = fundo.width
fundoheight = fundo.height
fundo_rect = Rect.new(0,0,fundowidth,fundoheight)
self.contents.blt(1+1,1,fundo,fundo_rect)
self.contents.font.color = Color.new(0,0,0)
self.contents.font.color = Color.new(0,0,0)
#Gold/Cash
self.contents.draw_text(30, 68, 35, 32, +$game_party.item_number(Item_Ouro::Item_Id.to_i))
#HP/SP/EXP
hpbar = RPG::Cache.picture("HP")
self.contents.font.size = 12
hpbarwidth = hpbar.width * @actor.hp / @actor.maxhp
hpbarheight = hpbar.height
hpbar_rect = Rect.new(0,0,hpbarwidth,hpbarheight)
self.contents.blt(38,23,hpbar,hpbar_rect)
if $game_party.actors[0].level <= 99
end
mpbar = RPG::Cache.picture("SP")
self.contents.font.size = 12
mpbarwidth = mpbar.width * @actor.sp / @actor.maxsp
mpbarheight = mpbar.height
mpbar_rect = Rect.new(0,0,mpbarwidth,mpbarheight)
self.contents.blt(38,41,mpbar,mpbar_rect)
if $game_party.actors[0].level <= 99
end
if $game_party.actors[0].level != 99
xpbar = RPG::Cache.picture("XP")
xpbarwidth = xpbar.width * @actor.now_exp / @actor.next_exp
xpbarheight = xpbar.height
xpbar_rect = Rect.new(0,0,xpbarwidth,xpbarheight)
self.contents.blt(38,59,xpbar,xpbar_rect)
end
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
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
Última edição por Leon Scott Kennedy em Qui Mar 29, 2012 3:55 pm, editado 3 vez(es)