07-12-2009, 04:19 AM
I am making a simple map system where the player opens a window which shows the player a picture of a world map for the game, however when i dispose of the window the image won't go away, it waits until rmxp clears it from the screen.
how can i fix this to dispose of the window of soon as the window is disposed of?
here is the script:
how can i fix this to dispose of the window of soon as the window is disposed of?
here is the script:
Code:
class Window_Map < Window_Base
def initialize
super(0,0,640,480)
self.contents = Bitmap.new(width-32,height-32)
self.contents.font.name = "Arial"
self.contents.font.size = 24
refresh
end
def refresh
self.contents.clear
@Map_Image = Sprite.new
@Map_Image.bitmap = RPG::Cache.picture("Map_Color.png")
@Map_Image.z = 100
end
end
Code:
class Map_Scene
def main
@Map = Window_Map.new
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
then break
end
end
Graphics.freeze
@Map.dispose
end
def update
@Map.update
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
end
end
end