- 0
How to close window when pressing "X" or "Esc" ?
Asked by
Izyees Fariz
-
Recently Browsing 0 members
No registered users viewing this page.
Asked by
Izyees Fariz
No registered users viewing this page.
Hello, I'm new in rgss1 .
I use this script :
class Window_2 < Window_Base def initialize super(0, 0, 640,380) self.contents = Bitmap.new(width-32, height-32) self.contents.font.name = "Arial" self.contents.font.size = 24 for i in 0...$game_party.actors.size x = 0 y = i * 90 actor = $game_party.actors[i] self.contents.font.color = text_color(6) self.contents.draw_text(x, y, 200, 32, $game_party.actors[i].name) self.contents.font.color = text_color(4) self.contents.draw_text(x+500, y, 200, 32, actor.class_name) self.contents.font.color = text_color(2) self.contents.draw_text(x, y+32, 200, 32, "Level : " + actor.level.to_s) end end end class Window_3 < Window_Base def initialize super(0, 380, 640,100) self.contents = Bitmap.new(width-32, height-32) self.contents.font.name = "Arial" self.contents.font.size = 24 self.contents.draw_text(0, 450, 200, 32, "Hello") end end #============================================================================== # * Scene_ShowWindow #============================================================================== class Scene_ShowWindow2 #-------------------------------------------------------------------------- # * Main Processing #-------------------------------------------------------------------------- def main #call the window @window = Window_2.new @window = Window_3.new # Execute transition Graphics.transition # Main loop loop do # Update game screen Graphics.update # Update input information Input.update # Frame update update # Abort loop if screen is changed if $scene != self break end end # Prepare for transition Graphics.freeze # Dispose of windows @window.dispose end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # Update windows @window.update # If B button was pressed if Input.trigger?(Input::B) # Play cancel SE $game_system.se_play($data_system.cancel_se) # Switch to Menu screen $scene = Scene_Map.new return end end endWhen i pressed "X" , it's only close the small window. The big window still in the map.
How can I make all window close when I pressing "X" ?
Thanks. :)
Share this post
Link to post
Share on other sites