Hello!
When I run the code below I get an undefined method 'font' when it hits the line:
self.contents.font.color = disabled_color
I've been using Window_Skill as a reference and it has no problem with it, so can anyone help me with what might be the problem? It's probably something simple... >.<
Tried searching to see if anyone had already asked something similar but I didn't see anything so far, so figured I'd ask. Thanks for any help.
When I run the code below I get an undefined method 'font' when it hits the line:
self.contents.font.color = disabled_color
I've been using Window_Skill as a reference and it has no problem with it, so can anyone help me with what might be the problem? It's probably something simple... >.<
Code:
class Window_SetSkills < Window_Selectable
def initialize
super(128, 64, 512, 416)
self.contents = Bitmap.new(width - 32, height - 32)
@columns = 2
refresh
self.index = 0
end
#DEFINE skill
# def skill
# return @data[self.index]
# end
#DEFINE refresh
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@numofskills = $game_skillset.size
if @numofskills > 0
for i in 0...@numofskills
draw_skillset(i)
end
end
#end definition
end
#Define draw_skillset, index is the position of the current skill in array
def draw_skillset(index)
skill = $game_skillset[index]
#Gray out if Hero already knows
if $game_party.actors[0].skill_learn?(skill.id)
self.contents.font.color = disabled_color
else
self.contents.font.color = normal_color
end
if (index % 2) == 0 #Even, left column
cx = contents.text_size(skill.name).width
self.contents.draw_text(0, (index / 2) * 32, cx, 32, skill.name, 0)
else #Odd, right column
cx = contents.text_size(skill.name).width
self.contents.draw_text(258, (index / 2 ) * 32, cx, 32, skill.name, 0)
end
#end definition
end
#Define update_helpinfo
def update_helpinfo
@window_help.set_text(self.skill == nil ? "" : self.skill.description)
end
#end of class
end
Tried searching to see if anyone had already asked something similar but I didn't see anything so far, so figured I'd ask. Thanks for any help.