Bonjour a tous !, voici mon nouveau Script = Scene_Title- ! ---------------------------------------------------------------------- Pourquoi Scene_Title- ? pour voir qui va se dire "si il y a un moins, c'est nul" et ce qui vont regarder la vidéo pour avoir leur avis.
Quels rajout pour l'ecran titre ? -des commandes personnalisé -une image qui apparaît -une image (bordure) -des lueur qui bouge (image)
Il y a plusieurs scipt ? Non, juste un, mais il faut quand même une demo avec toutes les images qu'il y a ! -------------------------------------------------------------------------- je vais vous laissez avec cette vidéo (mieux que des images !) :
le lien de téléchargement : http://www.mediafire.com/download/0vmvyndk1cl81o1/simple+title-.exe
(si le lien est mort, n’hésiter pas a me le dire.)
Dernière édition par eddy_de_galdon le Lun 16 Déc 2013 - 18:46, édité 1 fois
@part_1.visible = false @part_2.visible = false @part_3.visible = false @index = 0 # Continue enabled determinant # Check if at least one save file exists # If enabled, make @continue_enabled true; if disabled, make it false @continue_enabled = false for i in 0..3 if FileTest.exist?("Save#{i+1}.rxdata") @continue_enabled = true end end # Play title BGM $game_system.bgm_play($data_system.title_bgm) # Stop playing ME and BGS Audio.me_stop Audio.bgs_stop # 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 title graphic @sprite.bitmap.dispose @sprite.dispose @objeto.dispose @particula_01.dispose @particula_02.dispose @border.dispose @part_1.dispose @part_1.bitmap.dispose @part_2.dispose @part_2.bitmap.dispose @part_3.dispose @part_3.bitmap.dispose end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update @particula_01.opacity += 15 @particula_02.opacity += 15 @particula_01.ox += 2 @particula_01.oy += 2 @particula_02.ox += 1 @particula_02.oy += 1 @objeto.opacity += 1
case @index when 0 @part_1.visible = true @part_2.visible = false @part_3.visible = false when 1 @part_1.visible = false @part_2.visible = true @part_3.visible = false when 2 @part_1.visible = false @part_2.visible = false @part_3.visible = true end if Input.trigger?(Input::DOWN) @index += 1 @index = 0 if @index == 3 end
if Input.trigger?(Input::UP) @index -= 1 @index = 2 if @index == -1 end
if Input.trigger?(Input::C) case @index when 0 command_new_game when 1 command_continue when 2 command_shutdown end end end
#-------------------------------------------------------------------------- # * Command: New Game #-------------------------------------------------------------------------- def command_new_game # Play decision SE $game_system.se_play($data_system.decision_se) # Stop BGM Audio.bgm_stop # Reset frame count for measuring play time Graphics.frame_count = 0 # Make each type of game object $game_temp = Game_Temp.new $game_system = Game_System.new $game_switches = Game_Switches.new $game_variables = Game_Variables.new $game_self_switches = Game_SelfSwitches.new $game_screen = Game_Screen.new $game_actors = Game_Actors.new $game_party = Game_Party.new $game_troop = Game_Troop.new $game_map = Game_Map.new $game_player = Game_Player.new # Set up initial party $game_party.setup_starting_members # Set up initial map position $game_map.setup($data_system.start_map_id) # Move player to initial position $game_player.moveto($data_system.start_x, $data_system.start_y) # Refresh player $game_player.refresh # Run automatic change for BGM and BGS set with map $game_map.autoplay # Update map (run parallel process event) $game_map.update # Switch to map screen $scene = Scene_Map.new end #-------------------------------------------------------------------------- # * Command: Continue #-------------------------------------------------------------------------- def command_continue # If continue is disabled unless @continue_enabled # Play buzzer SE $game_system.se_play($data_system.buzzer_se) return end # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to load screen $scene = Scene_Load.new end #-------------------------------------------------------------------------- # * Command: Shutdown #-------------------------------------------------------------------------- def command_shutdown # Play decision SE $game_system.se_play($data_system.decision_se) # Fade out BGM, BGS, and ME Audio.bgm_fade(800) Audio.bgs_fade(800) Audio.me_fade(800) # Shutdown $scene = nil end #-------------------------------------------------------------------------- # * Battle Test #-------------------------------------------------------------------------- def battle_test # Load database (for battle test) $data_actors = load_data("Data/BT_Actors.rxdata") $data_classes = load_data("Data/BT_Classes.rxdata") $data_skills = load_data("Data/BT_Skills.rxdata") $data_items = load_data("Data/BT_Items.rxdata") $data_weapons = load_data("Data/BT_Weapons.rxdata") $data_armors = load_data("Data/BT_Armors.rxdata") $data_enemies = load_data("Data/BT_Enemies.rxdata") $data_troops = load_data("Data/BT_Troops.rxdata") $data_states = load_data("Data/BT_States.rxdata") $data_animations = load_data("Data/BT_Animations.rxdata") $data_tilesets = load_data("Data/BT_Tilesets.rxdata") $data_common_events = load_data("Data/BT_CommonEvents.rxdata") $data_system = load_data("Data/BT_System.rxdata") # Reset frame count for measuring play time Graphics.frame_count = 0 # Make each game object $game_temp = Game_Temp.new $game_system = Game_System.new $game_switches = Game_Switches.new $game_variables = Game_Variables.new $game_self_switches = Game_SelfSwitches.new $game_screen = Game_Screen.new $game_actors = Game_Actors.new $game_party = Game_Party.new $game_troop = Game_Troop.new $game_map = Game_Map.new $game_player = Game_Player.new # Set up party for battle test $game_party.setup_battle_test_members # Set troop ID, can escape flag, and battleback $game_temp.battle_troop_id = $data_system.test_troop_id $game_temp.battle_can_escape = true $game_map.battleback_name = $data_system.battleback_name # Play battle start SE $game_system.se_play($data_system.battle_start_se) # Play battle BGM $game_system.bgm_play($game_system.battle_bgm) # Switch to battle screen $scene = Scene_Battle.new end end
Sujet: Re: [XP]Scene_Title- Sam 7 Mai 2016 - 14:28
Alors normalement c'est tout à fait possible de le faire avec le script de base mais il est tellement mal fait que je me suis permis de l'éditer à savoir : - Retirer tout le code inutile (120 lignes) - Modifier le placement de l'image pour qu'il soit fait d'après son centre plutôt que son coin haut gauche - Indentation du code pour le rendre plus lisible
Du coup voici le script (à mettre au dessus de Main. il faut pas l'utiliser pour remplacer le Scene_title de base) :
Code:
#============================================================================== # ** Scene_Title #------------------------------------------------------------------------------ #crér par eddy_de_galdon (EDDY IKHLEF) #sur le modèle de baseà #==============================================================================
class Scene_Title #-------------------------------------------------------------------------- # * Main Processing #-------------------------------------------------------------------------- def main #images @particula_01 = Plane.new @particula_01.bitmap = RPG::Cache.title("lueur") @particula_01.z = 20 @particula_01.blend_type = 1 @particula_01.opacity = 0 @particula_01.visible = true @particula_02 = Plane.new @particula_02.bitmap = RPG::Cache.title("lueur") @particula_02.z = 250 @particula_02.ox = 320 @particula_02.oy = 240 @particula_02.blend_type = 1 @particula_02.opacity = 0 @particula_02.visible = true @border = Sprite.new @border.bitmap = RPG::Cache.title("bord") @border.z = 30 @border.blend_type = 1 @border.visible = true @objeto = Sprite.new @objeto.bitmap = RPG::Cache.title("objet") @objeto.z = 10 @objeto.x = 230 @objeto.y = 100 @objeto.visible = true @objeto.blend_type = 0 @objeto.opacity = 0 # If battle test if $BTEST battle_test return end # Load database $data_actors = load_data("Data/Actors.rxdata") $data_classes = load_data("Data/Classes.rxdata") $data_skills = load_data("Data/Skills.rxdata") $data_items = load_data("Data/Items.rxdata") $data_weapons = load_data("Data/Weapons.rxdata") $data_armors = load_data("Data/Armors.rxdata") $data_enemies = load_data("Data/Enemies.rxdata") $data_troops = load_data("Data/Troops.rxdata") $data_states = load_data("Data/States.rxdata") $data_animations = load_data("Data/Animations.rxdata") $data_tilesets = load_data("Data/Tilesets.rxdata") $data_common_events = load_data("Data/CommonEvents.rxdata") $data_system = load_data("Data/System.rxdata") # Make system object $game_system = Game_System.new # Make title graphic @sprite = Sprite.new @sprite.bitmap = RPG::Cache.title($data_system.title_name) # Make command window @part_1 = Sprite.new @part_1.bitmap = RPG::Cache.picture("new_jeu.png") @part_2 = Sprite.new @part_2.bitmap = RPG::Cache.picture("charger.png") @part_3 = Sprite.new @part_3.bitmap = RPG::Cache.picture("quitter.png") x_command = 320 y_command = 240 largeur = @part_1.bitmap.width / 2 hauteur = @part_1.bitmap.height / 2 #p [@part_1.bitmap.width, @part_1.bitmap.height] @part_1.x = @part_2.x = @part_3.x = x_command - largeur @part_1.y = @part_2.y = @part_3.y = y_command - hauteur @part_1.z = @part_2.z = @part_3.z = 11 @part_1.visible = false @part_2.visible = false @part_3.visible = false @index = 0 # Continue enabled determinant # Check if at least one save file exists # If enabled, make @continue_enabled true; if disabled, make it false @continue_enabled = false for i in 0..3 if FileTest.exist?("Save#{i+1}.rxdata") @continue_enabled = true end end # Play title BGM $game_system.bgm_play($data_system.title_bgm) # Stop playing ME and BGS Audio.me_stop Audio.bgs_stop # 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 title graphic @sprite.bitmap.dispose @sprite.dispose @objeto.dispose @particula_01.dispose @particula_02.dispose @border.dispose @part_1.dispose @part_1.bitmap.dispose @part_2.dispose @part_2.bitmap.dispose @part_3.dispose @part_3.bitmap.dispose end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update @particula_01.opacity += 15 @particula_02.opacity += 15 @particula_01.ox += 2 @particula_01.oy += 2 @particula_02.ox += 1 @particula_02.oy += 1 @objeto.opacity += 1 case @index when 0 @part_1.visible = true @part_2.visible = false @part_3.visible = false when 1 @part_1.visible = false @part_2.visible = true @part_3.visible = false when 2 @part_1.visible = false @part_2.visible = false @part_3.visible = true end if Input.trigger?(Input::DOWN) @index += 1 @index = 0 if @index == 3 end if Input.trigger?(Input::UP) @index -= 1 @index = 2 if @index == -1 end if Input.trigger?(Input::C) case @index when 0 command_new_game when 1 command_continue when 2 command_shutdown end end end end
Pour mettre à l'horizontale les menus il suffit d'aller dans Graphics/Pictures et remplacer simplement les images par de nouvelles avec les termes alignés à l'horizontal. Dernière chose pour configurer la position du menu il suffit de se rendre aux lignes de code 72-73 :
Code:
x_command = 320 y_command = 240
et de donner à x_command le position en x du centre et à y_command le position en y du centre. Voilà
Edit : au passage, pour remplacer l'utilisation des touches haut/bas par gauche/droite il faut aller ligne 154 et remplacer :
Code:
if Input.trigger?(Input::DOWN) @index += 1 @index = 0 if @index == 3 end if Input.trigger?(Input::UP) @index -= 1 @index = 2 if @index == -1 end
par
Code:
if Input.trigger?(Input::RIGHT) @index += 1 @index = 0 if @index == 3 end if Input.trigger?(Input::LEFT) @index -= 1 @index = 2 if @index == -1 end
Dernière édition par Hellper le Sam 7 Mai 2016 - 14:37, édité 1 fois