Code: |
#========================================================================== # ■ Annuaire # Projet Rise - Xyrram # 02/01/15 #------------------------------------------------------------------------------ class ANNUAIRE attr_accessor :index def initialize(index = 0) @index = index @fond = Sprite.new @fond.bitmap = RPG::Cache.picture("1.png") def main @spriteset = Spriteset_Map.new s1 = "Personnages Principaux" s2 = "Personnages Secondaires" s3 = "Quitter" @command_window = Window_Command.new(160, [s1, s2, s3]) @command_window.index = @menu_index @command_window.x = 480 - 3 @command_window.y = 3 end Graphics.transition loop do Graphics.update Input.update update if $scene != self break end def update self.contents.clear # Boucle pour afficher chaque commande for i in 0...@item_max # Position X selon i x = 4 + i * 160 # Taille du texte text_size = self.contents.text_size(@commands[i]).width # Affichage du texte. self.contents.draw_text(x, 0, text_size, 32, @commands[i]) @command.update @item_max.update @column_max.update def update_command # B ボタンが押された場合 if Input.trigger?(Input::B) # キャンセル SE を演奏 $game_system.se_play($data_system.cancel_se) # マップ画面に切り替え $scene = Scene_Map.new return if Input.trigger?(Input::C) case @command_window.index when 0 #Personnage Principaux if not($data_pokedex[0]) $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) $scene = Pokemon_Pokedex.new when 1 #Personnages secondaires if $pokemon_party.size == 0 $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) $scene = Pokemon_Party_Menu.new when 2 #Quitter $game_system.se_play($data_system.decision_se) $scene = Pokemon_Map.new end return end end end end end |
Xyrram a écrit: |
erreur de Syntaxe à la derniere ligne (...) |
Code: |
def update_cursor_rect # Redéfinition if @index < 0 self.cursor_rect.empty return end row = @index / @column_max if row < self.top_row self.top_row = row end |
Code: |
#========================================================================== # ■ Annuaire # Projet Rise - Xyrram # 02/01/15 #------------------------------------------------------------------------------ class ANNUAIRE def initialize(index = 0) @fond = Sprite.new @fond.bitmap = RPG::Cache.picture("1.png") @spriteset = Spriteset_Map.new s1 = "Personnages Principaux" s2 = "Personnages Secondaires" s3 = "Quitter" @command_window = Window_Command.new(320, [s1, s2, s3]) @command_window.index = index @command_window.x = 480 - @command_window.width/2 - 3 @command_window.y = 3 end def main Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze @command_window.dispose @spriteset.dispose end def update update_command @command_window.update end def update_command # B ボタンが押された場合 if Input.trigger?(Input::B) # キャンセル SE を演奏 $game_system.se_play($data_system.cancel_se) # マップ画面に切り替え $scene = Scene_Map.new return end if Input.trigger?(Input::C) case @command_window.index when 0 #Personnage Principaux if not($data_pokedex[0]) $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) $scene = Pokemon_Pokedex.new when 1 #Personnages secondaires if $pokemon_party.size == 0 $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) $scene = Pokemon_Party_Menu.new when 2 #Quitter $game_system.se_play($data_system.decision_se) $scene = Pokemon_Map.new end return end end end |