I'm trying to make my window have an image instead of the windowskin, but the image doesn't want to display. This is my script:
How do I fix this?
Thanks.
Code:
class Window_Itachi_One < Window_Base
def initialize
super(0, 300, 70, 70)
self.contents = Bitmap.new(width-32, height-32)
self.contents.font.name = 'Arial'
self.contents.font.size = 24
self.contents.font.color = text_color(2)
@var = nil
refresh
end
def to_s
$game_variables[15].to_s
end
def refresh
self.contents.clear
@bitmap = RPG::Cache.picture("HUD_Infection")
self.contents.blt(width/3, height/3, @bitmap, Rect.new(0, 0, @bitmap.width, @bitmap.height), 160)
self.contents.draw_text(0, 0, 100, 32, to_s + "%")
end
def update
return if @var == $game_variables[15]
@var = $game_variables[15]
refresh
end
end
class Scene_Map
alias_method :old_main, :main
alias_method :old_update, :update
def main
@window = Window_Itachi_One.new
old_main
@window.dispose
end
def update
@window.update
old_update
end
end
Thanks.