Started by diagostimo, March 02, 2012, 11:00:54 pm
#==============================================================================# ** Window_Map#------------------------------------------------------------------------------class Window_MapMenu < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0, 640, 480) self.contents = Bitmap.new(width - 32, height - 32) @index = 0 update_cursor_rect refresh end #------------------------------------------------------------------------- # * def index #------------------------------------------------------------------------- def index=(index) @index = index # Update Help Text (update_help is defined by the subclasses) if self.active and @help_window != nil update_help end # Update cursor rectangle update_cursor_rect end #-------------------------------------------------------------------------- # * Cursor Rectangle Update #-------------------------------------------------------------------------- def update_cursor_rect x = 32 + @index % 17 * 32 y = 0 + @index / 17 % 14 * 32 self.cursor_rect.set(x, y, 32, 32) end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh @bitmap = RPG::Cache.picture("kantomap.png") self.contents.blt(32, 0, @bitmap, Rect.new(0, 0, @bitmap.width, @bitmap.height), 160) end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update super # if enter is being pressed if Input.trigger?(Input::C) if @index == 172 # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to item screen $scene = Scene_PalletTown.new end end # If right directional button is pushed if Input.repeat?(Input::RIGHT) # If directional button pressed down is not a repeat, or # cursor is not positioned on the right edge if Input.trigger?(Input::RIGHT) or @index % 17 < 16 # Move cursor to right $game_system.se_play($data_system.cursor_se) if @index % 17 < 16 @index += 1 end end end # If left directional button is pushed if Input.repeat?(Input::LEFT) # If directional button pressed down is not a repeat, or # cursor is not positioned on the left edge if Input.trigger?(Input::LEFT) or @index % 17 > 0 # Move cursor to left $game_system.se_play($data_system.cursor_se) if @index % 17 > 0 @index -= 1 end end end # If down directional button is pushed if Input.repeat?(Input::DOWN) # Move cursor down if @index / 17 < 13 @index += 17 $game_system.se_play($data_system.cursor_se) end end # If up directional button is pushed if Input.repeat?(Input::UP) # Move cursor up if @index / 17 > 0 @index -= 17 $game_system.se_play($data_system.cursor_se) end end update_cursor_rect endend#---------------------------------------------------------------------------# * Scene Map_Menu#---------------------------------------------------------------------------class Scene_MapMenu def initialize(index = 0) @index = index end #------------------------------------------------------------------------- # * MAIN #------------------------------------------------------------------------- def main @mapmenu_window = Window_MapMenu.new @mapmenu_window.index = @index # 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 @mapmenu_window.dispose end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # Update windows @mapmenu_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_Item.new return end endend#---------------------------------------------------------------------------# * class Window_PalletTown#---------------------------------------------------------------------------class Window_PalletTown < Window_Base #------------------------------------------------------------------------- # * Object Initialization #------------------------------------------------------------------------- def initialize super(0, 0, 416, 352) self.contents = Bitmap.new(width - 32, height - 32) refresh end #------------------------------------------------------------------------- # * refresh #------------------------------------------------------------------------- def refresh @bitmap = RPG::Cache.picture("pallettown.png") self.contents.blt(0, 0, @bitmap, Rect.new(0, 0, @bitmap.width, @bitmap.height), 255) endend#---------------------------------------------------------------------------# * Scene_PalletTown#---------------------------------------------------------------------------class Scene_PalletTown #------------------------------------------------------------------------- # * Main #------------------------------------------------------------------------- def main @pallettown_window = Window_PalletTown.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 @pallettown_window.dispose end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # Update windows @pallettown_window.update # if mapmenu is active call update_map # If B button was pressed if Input.trigger?(Input::B) # Play cancel SE $game_system.se_play($data_system.cancel_se) # Switch to map screen $scene = Scene_MapMenu.new(172) return end endend
self.back_opacity = 0
class Scene_Alias def main @sprite = Sprite.new @sprite.bitmap = RPG::Cache.picture("picture name") Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end @sprite.dispose endend