Ok... I'm making a script, of a window, with lots of text drawn. I tested each of the variables with print, and they all have a value (even if that value is " " or "0").
But it doesn't draw any text.
Note: I commented out the armour lines as I'm having trouble with the syntax, if anyone could help me with that it'd be great
What this does is draws a window which looks like this:
Daniel
Weapon: Bronze Sword
Armour: Bronze Armour
B | R | % | S | A- | Lv
1 | 3 | 70| 3 | 2 | 1
(The letters and lines are to be added on by a graphical overlay).
But it doesn't draw any text.
Note: I commented out the armour lines as I'm having trouble with the syntax, if anyone could help me with that it'd be great
Code:
class Window_HudStatline < Window_Base
def initialize
super(373-16, 57-16, 200, 200)
self.contents = Bitmap.new(width, height)
self.opacity = 0
self.z = 9999
x = 16
y = 16
refresh
end
def refresh
self.contents.clear
@name = $user_name_pl
actor = $game_party.actors[0]
@weapon = $data_weapons[actor.weapon_id].name
@armourstat = ""
#@armour = $data_armors[actor.armor2_id].name
#@armourstat = $data_armors[actor.armor1_id].pdef
#@armourstat += $data_armors[actor.armor2_id].pdef
#@armourstat += $data_armors[actor.armor3_id].pdef
#@armourstat += $data_armors[actor.armor4_id].pdef
@weaponbase = $data_weapons[actor.weapon_id].atk
@weaponrand = $data_weapons[actor.weapon_id].str_plus
@weaponperc = $data_weapons[actor.weapon_id].agi_plus
@weaponspee = $data_weapons[actor.weapon_id].mdef
a = actor.maxhp + actor.maxsp
b = a / 2
c = b - 9
@statline = "#{@weaponbase} "
@statline += "#{@weaponrand} "
@statline += "#{@weaponbase} "
@statline += "#{@weaponspee} "
@statline += "#{@armourstat} "
@statline += "#{c}"
@statline = @statline.to_s
self.contents.draw_text(x, y, 100, 20, @name.to_s)
self.contents.draw_text(x, y+16, 100, 20, "Weapon: " + @weapon.to_s)
self.contents.draw_text(x, y+32, 100, 20, "Armour: " + @armour.to_s)
self.contents.draw_text(x+10, y+61, 100, 20, @statline)
end
end
What this does is draws a window which looks like this:
Daniel
Weapon: Bronze Sword
Armour: Bronze Armour
B | R | % | S | A- | Lv
1 | 3 | 70| 3 | 2 | 1
(The letters and lines are to be added on by a graphical overlay).