its said he cant convert fixnum to a string in the line where i draw the label....
line 31 ....
#Script: Hud - Hp / Mp / EXP Bar Also Name / Level / Class Labels
#Base on Dark Tornado Script.
#edit by Ariel_tete94
#Ver: 1.6
#Date: 20/12/09
class Sprite_Hud
def initialize
draw_hud
end
def draw_hud
@hp_bar = Sprite.new
@bg_hp_bar = Sprite.new
@mp_bar = Sprite.new
@bg_mp_bar = Sprite.new
@exp_bar = Sprite.new
@bg_exp_bar = Sprite.new
@sprite = Sprite.new
@actor = $game_party.actors[0]
@explabel = @actor.exp / @actor.next_exp_s.to_i * 100
#TEXT
@sprite.bitmap = RPG::Cache.hud("main_bg_hud.png")
@sprite.bitmap.font.size = 25
@sprite.bitmap.draw_text(40, -16, 100, 100, @actor.level.to_s, 1)
@sprite.bitmap.font.size = 16
@sprite.bitmap.draw_text(35, 5, 100, 100, @actor.name.to_s, 1)
@sprite.bitmap.draw_text(37, 25, 100, 100, @actor.class_name.to_s, 1)
@sprite.bitmap.draw_text(72, 38, 100, 100, @explabel, 1)
@sprite.bitmap.draw_text(85, 38, 100, 100, "%", 1)
#END
@background = Sprite.new
@background.bitmap = RPG::Cache.hud("main_bg_hud.png")
@background.z = 98
@background.tone.gray = 255
@bg_hp_bar.bitmap = RPG::Cache.hud("main_hp_hud.png")
@bg_hp_bar.z = 99
@bg_hp_bar.x = 137
@bg_hp_bar.y = 52
@bg_hp_bar.tone = Tone.new(-85,-85,-85,100)
@hp_bar.bitmap = RPG::Cache.hud("main_hp_hud.png")
@width = @hp_bar.bitmap.width
@hp_bar.x = @bg_hp_bar.x
@hp_bar.y = @bg_hp_bar.y
@hp_bar.z = 100
@bg_mp_bar.bitmap = RPG::Cache.hud("main_hp_hud.png",225)
@bg_mp_bar.z = 99
@bg_mp_bar.x = 137
@bg_mp_bar.y = 74
@bg_mp_bar.tone = Tone.new(-85,-85,-85,100)
@mp_bar.bitmap = RPG::Cache.hud("main_hp_hud.png",225)
@mp_bar.z = 100
@mp_bar.x = 137
@mp_bar.y = 74
@bg_exp_bar.bitmap = RPG::Cache.hud("main_exp_hud.png")
@bg_exp_bar.z = 99
@bg_exp_bar.x = 2
@bg_exp_bar.y = 59
@bg_exp_bar.tone = Tone.new(-85,-85,-85,150)
@exp_bar.bitmap = RPG::Cache.hud("main_exp_hud.png")
@width = @exp_bar.bitmap.width
@exp_bar.x = @bg_exp_bar.x
@exp_bar.y = @bg_exp_bar.y
@exp_bar.z = 100
end
def update
draw_hud if (@hp_bar == nil or @hp_bar.disposed?)
@xscale = ($game_party.actors[0].hp.to_f / $game_party.actors[0].maxhp.to_f * @width.to_f).to_f
@hp_bar.src_rect.width = @xscale
@xscale2 = ($game_party.actors[0].sp.to_f / $game_party.actors[0].maxsp.to_f * @width.to_f).to_f
@mp_bar.src_rect.width = @xscale2
@xscale2 = ($game_party.actors[0].exp_s.to_f / $game_party.actors[0].next_exp_s.to_f * @width.to_f).to_f
@exp_bar.src_rect.width = @xscale2
end
def dispose
@hp_bar.dispose
@bg_hp_bar.dispose
@mp_bar.dispose
@bg_mp_bar.dispose
@background.dispose
@exp_bar.dispose
@bg_exp_bar.dispose
@hp_bar = nil
@bg_hp_bar = nil
@exp_bar = nil
@bg_exp_bar = nil
@mp_bar = nil
@bg_mp_bar = nil
@background = nil
end
end
class Spriteset_Map
alias initialize_hud initialize
alias update_hud update
alias dispose_hud dispose
def initialize
@hud = Sprite_Hud.new
initialize_hud
end
def update
update_hud
@hud.update
end
def dispose
dispose_hud
@hud.dispose
end
end
module RPG
module Cache
def self.hud(filename, hue = 0)
self.load_bitmap("Graphics/Huds/", filename, hue)
end
end
end