I've done a custom window that shows the HP, SP and the player's name and I want to add a special feature:
I want to show: [ICON] Skill name wich ID in the database is 21.
This is the code for that custom window:
It's supposed to go here:
http://i17.photobucket.com/albums/b76/G ... helpme.png[/IMG]
I don't know waht to do, I tried to learn something reading the Window_Skill, Scene_Skill and the Game_Actor classes but can't do anything.
I want to show: [ICON] Skill name wich ID in the database is 21.
This is the code for that custom window:
Code:
class GR_Window_HUD < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
# actor : actor
#--------------------------------------------------------------------------
def initialize
super(0, 0, 640, 480)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
self.z = 255
self.contents.font.size = 16
@actor = $game_party.actors[0]
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.bold = true
draw_actor_name(@actor, 408, 0)
draw_actor_hpEX(@actor, 390, 17)
draw_actor_spEX(@actor, 406, 34)
self.contents.font.bold = false
end
#--------------------------------------------------------------------------
# * Draw Skill
# index : database skill index number
#--------------------------------------------------------------------------
def draw_skill(index)
skill = $data_skills(index) # or (21) don't works
x = 400
y = 64
bitmap = RPG::Cache.icon(skill.icon_name)# this is supposed to draw the skill icon but the game crashes
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
end
end
http://i17.photobucket.com/albums/b76/G ... helpme.png[/IMG]
I don't know waht to do, I tried to learn something reading the Window_Skill, Scene_Skill and the Game_Actor classes but can't do anything.