|
| Auteur | Message |
---|
eddy_de_galdon Chevalier Dragon (niveau 2)
Messages postés : 807 Date d'inscription : 31/08/2013 Jauge LPC :
| Sujet: [XP] MENU G Lun 16 Déc 2013 - 19:25 | |
| Après quelque jours sans coder, voici mon nouveau script !!! MENU G (Scene_Menu) :-customize le menu pour un rendu plus joli. -peut afficher des faces - options pour les faces :
les images doivent faire 80x80 et elles doivent etre placer dans le dossier pictures. ces images doivent avoir le meme nom du heros utilisé.
- Code:
-
#============================================================================== # ** Menu G #------------------------------------------------------------------------------ #crér par : eddy de galdon #transparence par : Makoto ? #Merci a shin pour avoir regroupé tout les scripts en un ! # #MAJ 16/01/14 : ajout de l'exp #MAJ 19/02/14 : position des fentres pas|argent|temps de jeu au hasard # #les images doivent faire 80x80 et elles doivent etre placer dans le dossier #pictures. ces images doivent avoir le meme nom du heros utilisé. #============================================================================== #MODIFICATION : #============================================================================== #Ligne 346 : #Coordonées X a modifier si le nom d'une classe ou d'un héros est trop long
#Ligne 73 : modifier pour d'autres nom #============================================================================== #MODULE TRANSPARENCE DEBUT module XRXS_MP7_Module def create_spriteset # ƒXƒvƒ‰ƒCƒgƒZƒbƒg‚ðì¬ @spriteset = Spriteset_Map.new end def dispose_spriteset # ƒXƒvƒ‰ƒCƒgƒZƒbƒg‚ð‰ð•ú @spriteset.dispose end end
class Window_Base < Window alias xrxs_mp7_initialize initialize def initialize(x, y, width, height) xrxs_mp7_initialize(x, y, width, height) if $scene.is_a?(Scene_Menu) or $scene.is_a?(Scene_Item) or $scene.is_a?(Scene_Skill) or $scene.is_a?(Scene_Equip) or $scene.is_a?(Scene_Status) or $scene.is_a?(Scene_Save) or $scene.is_a?(Scene_End) self.back_opacity = 160 end end def draw_facesets(actor, x, y) back = RPG::Cache.picture(actor.name) cw = back.width ch = back.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x - cw / 2, y - ch, back, src_rect) end def draw_actor_name(actor, x, y) self.contents.font.color = normal_color self.contents.draw_text(x, y, 120, 32, actor.name) end end #MODULE TRANSPARENCE FIN #============================================================================== # ** Menu G -début- #------------------------------------------------------------------------------ class Scene_Menu include XRXS_MP7_Module #-------------------------------------------------------------------------- # * Object Initialization # menu_index : command cursor's initial position #-------------------------------------------------------------------------- def initialize(menu_index = 0) @menu_index = menu_index end #-------------------------------------------------------------------------- # * Main Processing #-------------------------------------------------------------------------- def main create_spriteset # Make command window s1 = $data_system.words.item s2 = $data_system.words.skill s3 = $data_system.words.equip s4 = "Statut" s5 = "Sauvegarder" s6 = "Quitter le jeu" @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6]) @command_window.index = @menu_index # If number of party members is 0 if $game_party.actors.size == 0 # Disable items, skills, equipment, and status @command_window.disable_item(0) @command_window.disable_item(1) @command_window.disable_item(2) @command_window.disable_item(3) end # If save is forbidden if $game_system.save_disabled # Disable save @command_window.disable_item(4) end # Make play time window @playtime_window = Window_PlayTime.new @playtime_window.x = 0 + rand(120) @playtime_window.y = 224 # Make steps window @steps_window = Window_Steps.new @steps_window.x = 0 + rand (120) @steps_window.y = 320 # Make gold window @gold_window = Window_Gold.new @gold_window.x = 0 + rand (120) @gold_window.y = 416 # Make status window @status_window = Window_MenuStatus.new @status_window.x = 280 @status_window.y = 0 # 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 @command_window.dispose @playtime_window.dispose @steps_window.dispose @gold_window.dispose @status_window.dispose dispose_spriteset end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # Update windows @command_window.update @playtime_window.update @steps_window.update @gold_window.update @status_window.update # If command window is active: call update_command if @command_window.active update_command return end # If status window is active: call update_status if @status_window.active update_status return end end #-------------------------------------------------------------------------- # * Frame Update (when command window is active) #-------------------------------------------------------------------------- def update_command # 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_Map.new return end # If C button was pressed if Input.trigger?(Input::C) # If command other than save or end game, and party members = 0 if $game_party.actors.size == 0 and @command_window.index < 4 # Play buzzer SE $game_system.se_play($data_system.buzzer_se) return end # Branch by command window cursor position case @command_window.index when 0 # item # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to item screen $scene = Scene_Item.new when 1 # skill # Play decision SE $game_system.se_play($data_system.decision_se) # Make status window active @command_window.active = false @status_window.active = true @status_window.index = 0 when 2 # equipment # Play decision SE $game_system.se_play($data_system.decision_se) # Make status window active @command_window.active = false @status_window.active = true @status_window.index = 0 when 3 # status # Play decision SE $game_system.se_play($data_system.decision_se) # Make status window active @command_window.active = false @status_window.active = true @status_window.index = 0 when 4 # save # If saving is forbidden if $game_system.save_disabled # 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 save screen $scene = Scene_Save.new when 5 # end game # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to end game screen $scene = Scene_End.new end return end end #-------------------------------------------------------------------------- # * Frame Update (when status window is active) #-------------------------------------------------------------------------- def update_status # If B button was pressed if Input.trigger?(Input::B) # Play cancel SE $game_system.se_play($data_system.cancel_se) # Make command window active @command_window.active = true @status_window.active = false @status_window.index = -1 return end # If C button was pressed if Input.trigger?(Input::C) # Branch by command window cursor position case @command_window.index when 1 # skill # If this actor's action limit is 2 or more if $game_party.actors[@status_window.index].restriction >= 2 # 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 skill screen $scene = Scene_Skill.new(@status_window.index) when 2 # equipment # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to equipment screen $scene = Scene_Equip.new(@status_window.index) when 3 # status # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to status screen $scene = Scene_Status.new(@status_window.index) end return end end end #============================================================================== # ** Menu G -fin- #------------------------------------------------------------------------------ class Scene_Item include XRXS_MP7_Module alias xrxs_mp7_main main def main create_spriteset xrxs_mp7_main dispose_spriteset end end class Scene_Skill include XRXS_MP7_Module alias xrxs_mp7_main main def main create_spriteset xrxs_mp7_main dispose_spriteset end end class Scene_Equip include XRXS_MP7_Module alias xrxs_mp7_main main def main create_spriteset xrxs_mp7_main dispose_spriteset end end class Scene_Status include XRXS_MP7_Module alias xrxs_mp7_main main def main create_spriteset xrxs_mp7_main dispose_spriteset end end class Scene_Save include XRXS_MP7_Module alias xrxs_mp7_main main def main create_spriteset xrxs_mp7_main dispose_spriteset end end class Scene_End alias xrxs_mp7_main main def main xrxs_mp7_main end end
#------------------------------------------------------------------------------#
class Window_MenuStatus < Window_Selectable #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0, 360, 480) self.contents = Bitmap.new(width - 32, height - 32) refresh self.active = false self.index = -1 end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear @item_max = $game_party.actors.size for i in 0...$game_party.actors.size x = 64 y = i * 116 actor = $game_party.actors[i] draw_facesets(actor, x + 60, y + 80) #CORDONER A MODIFIER EN X SI LE NOM EST TROP LONG draw_actor_name(actor, x -50, y - 10) draw_actor_class(actor, x -65, y + 20) draw_actor_state(actor, x -60, y + 40) draw_actor_level(actor, x + 100, y - 5) draw_actor_hp(actor, x + 100, y + 12) draw_actor_sp(actor, x + 100, y + 32) draw_actor_exp(actor, x - 50, y + 72) end end #-------------------------------------------------------------------------- # * Cursor Rectangle Update #-------------------------------------------------------------------------- def update_cursor_rect if @index < 0 self.cursor_rect.empty else self.cursor_rect.set(0, @index * 116, self.width - 32, 96) end end end
Voici le rendu final du menu G : ------------------------------------------------------------------------------------------------------- j'espère que ce script va vous plaire ! "si il y a un bug avec les scripts, dites le moi.
Dernière édition par eddy_de_galdon le Mer 19 Fév 2014 - 19:04, édité 6 fois |
| | | eddy_de_galdon Chevalier Dragon (niveau 2)
Messages postés : 807 Date d'inscription : 31/08/2013 Jauge LPC :
| Sujet: Re: [XP] MENU G Mar 17 Déc 2013 - 19:16 | |
| 17.12.2013 : Bug corrigé : oubli du bout de code dans "MenuStatut G" pour afficher les "Faces" |
| | | Elekami Fondateur
Messages postés : 19071 Date d'inscription : 19/07/2008 Jauge LPC :
| Sujet: Re: [XP] MENU G Mar 17 Déc 2013 - 23:13 | |
| Bonsoir, merci du partage. |
| | | eddy_de_galdon Chevalier Dragon (niveau 2)
Messages postés : 807 Date d'inscription : 31/08/2013 Jauge LPC :
| Sujet: Re: [XP] MENU G Mer 18 Déc 2013 - 19:26 | |
| j'amerais bien savoir si un scripteur un peu plus confirmé avec le RGSS pourrait reussir a modifier les scripts pour qu'il sont tous reunni en un seule code. Merci ! |
| | | shin Chevalier Dragon (niveau 1)
Messages postés : 726 Date d'inscription : 18/10/2011 Jauge LPC :
| Sujet: Re: [XP] MENU G Mer 18 Déc 2013 - 20:19 | |
| Il ne devrais pas avoire de probleme normalement (peut pas tester j'ai pas RMXP). J'ai un peus refais l'indentation (surtout pour le script de XRXS (il me semble que sont vrais pseudo c'est Makoto mais pas sur ^^) je sait pas ou tu la pris mais l'indentation étais bah inexistante ^^). j'ai remarqué une ou deux petite erreur de codage mais si tu n'as pas remarquer de bug alors tout vas bien. essaye d'utiliser ton script avec 4 perso ou moins dans la base de donnée.(juste pour vérifier un truc) Je te conseille de faire un module ou d'utiliser celui de XRXS pour modifier les coordonée x du nom des persos car perssone auras l'idée d'aller voire ton commentaire en plein millieu du script. - Code:
-
#============================================================================== # ** Menu G #------------------------------------------------------------------------------ #crér par : eddy de galdon pour : l'ile endormie # #les images doivent faire 80x80 et elles doivent etre placer dans le dossier #pictures. ces images doivent avoir le meme nom du heros utilisé. #============================================================================== module XRXS_MP7_Module def create_spriteset # ƒXƒvƒ‰ƒCƒgƒZƒbƒg‚ðì¬ @spriteset = Spriteset_Map.new end def dispose_spriteset # ƒXƒvƒ‰ƒCƒgƒZƒbƒg‚ð‰ð•ú @spriteset.dispose end end
class Window_Base < Window alias xrxs_mp7_initialize initialize def initialize(x, y, width, height) xrxs_mp7_initialize(x, y, width, height) if $scene.is_a?(Scene_Menu) or $scene.is_a?(Scene_Item) or $scene.is_a?(Scene_Skill) or $scene.is_a?(Scene_Equip) or $scene.is_a?(Scene_Status) or $scene.is_a?(Scene_Save) or $scene.is_a?(Scene_End) self.back_opacity = 160 end end def draw_facesets(actor, x, y) back = RPG::Cache.picture(actor.name) cw = back.width ch = back.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x - cw / 2, y - ch, back, src_rect) end def draw_actor_name(actor, x, y) self.contents.font.color = normal_color self.contents.draw_text(x, y, 120, 32, actor.name) end end
class Scene_Menu include XRXS_MP7_Module #-------------------------------------------------------------------------- # * Object Initialization # menu_index : command cursor's initial position #-------------------------------------------------------------------------- def initialize(menu_index = 0) @menu_index = menu_index end #-------------------------------------------------------------------------- # * Main Processing #-------------------------------------------------------------------------- def main create_spriteset # Make command window s1 = $data_system.words.item s2 = $data_system.words.skill s3 = $data_system.words.equip s4 = "Statut" s5 = "Sauvegarder" s6 = "Quitter le jeu" @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6]) @command_window.index = @menu_index # If number of party members is 0 if $game_party.actors.size == 0 # Disable items, skills, equipment, and status @command_window.disable_item(0) @command_window.disable_item(1) @command_window.disable_item(2) @command_window.disable_item(3) end # If save is forbidden if $game_system.save_disabled # Disable save @command_window.disable_item(4) end # Make play time window @playtime_window = Window_PlayTime.new @playtime_window.x = 120 @playtime_window.y = 224 # Make steps window @steps_window = Window_Steps.new @steps_window.x = 0 @steps_window.y = 320 # Make gold window @gold_window = Window_Gold.new @gold_window.x = 120 @gold_window.y = 416 # Make status window @status_window = Window_MenuStatus.new @status_window.x = 280 @status_window.y = 0 # 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 @command_window.dispose @playtime_window.dispose @steps_window.dispose @gold_window.dispose @status_window.dispose dispose_spriteset end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # Update windows @command_window.update @playtime_window.update @steps_window.update @gold_window.update @status_window.update # If command window is active: call update_command if @command_window.active update_command return end # If status window is active: call update_status if @status_window.active update_status return end end #-------------------------------------------------------------------------- # * Frame Update (when command window is active) #-------------------------------------------------------------------------- def update_command # 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_Map.new return end # If C button was pressed if Input.trigger?(Input::C) # If command other than save or end game, and party members = 0 if $game_party.actors.size == 0 and @command_window.index < 4 # Play buzzer SE $game_system.se_play($data_system.buzzer_se) return end # Branch by command window cursor position case @command_window.index when 0 # item # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to item screen $scene = Scene_Item.new when 1 # skill # Play decision SE $game_system.se_play($data_system.decision_se) # Make status window active @command_window.active = false @status_window.active = true @status_window.index = 0 when 2 # equipment # Play decision SE $game_system.se_play($data_system.decision_se) # Make status window active @command_window.active = false @status_window.active = true @status_window.index = 0 when 3 # status # Play decision SE $game_system.se_play($data_system.decision_se) # Make status window active @command_window.active = false @status_window.active = true @status_window.index = 0 when 4 # save # If saving is forbidden if $game_system.save_disabled # 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 save screen $scene = Scene_Save.new when 5 # end game # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to end game screen $scene = Scene_End.new end return end end #-------------------------------------------------------------------------- # * Frame Update (when status window is active) #-------------------------------------------------------------------------- def update_status # If B button was pressed if Input.trigger?(Input::B) # Play cancel SE $game_system.se_play($data_system.cancel_se) # Make command window active @command_window.active = true @status_window.active = false @status_window.index = -1 return end # If C button was pressed if Input.trigger?(Input::C) # Branch by command window cursor position case @command_window.index when 1 # skill # If this actor's action limit is 2 or more if $game_party.actors[@status_window.index].restriction >= 2 # 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 skill screen $scene = Scene_Skill.new(@status_window.index) when 2 # equipment # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to equipment screen $scene = Scene_Equip.new(@status_window.index) when 3 # status # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to status screen $scene = Scene_Status.new(@status_window.index) end return end end end class Scene_Item include XRXS_MP7_Module alias xrxs_mp7_main main def main create_spriteset xrxs_mp7_main dispose_spriteset end end class Scene_Skill include XRXS_MP7_Module alias xrxs_mp7_main main def main create_spriteset xrxs_mp7_main dispose_spriteset end end class Scene_Equip include XRXS_MP7_Module alias xrxs_mp7_main main def main create_spriteset xrxs_mp7_main dispose_spriteset end end class Scene_Status include XRXS_MP7_Module alias xrxs_mp7_main main def main create_spriteset xrxs_mp7_main dispose_spriteset end end class Scene_Save include XRXS_MP7_Module alias xrxs_mp7_main main def main create_spriteset xrxs_mp7_main dispose_spriteset end end class Scene_End alias xrxs_mp7_main main def main create_spriteset xrxs_mp7_main dispose_spriteset end end
#------------------------------------------------------------------------------# class Window_MenuStatus < Window_Selectable #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0, 360, 480) self.contents = Bitmap.new(width - 32, height - 32) refresh self.active = false self.index = -1 end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear @item_max = $game_party.actors.size for i in 0...$game_party.actors.size x = 64 y = i * 116 actor = $game_party.actors[i] draw_facesets(actor, x + 60, y + 80) draw_actor_name(actor, x -50, y - 10) draw_actor_class(actor, x -65, y + 20)#CORDONER A MODIFIER EN X SI LE NOM DE LA CLASSE EST TROP LONG draw_actor_state(actor, x -60, y + 40) draw_actor_level(actor, x + 100, y + 12) draw_actor_hp(actor, x + 100, y + 32) draw_actor_sp(actor, x + 100, y + 52) end end #-------------------------------------------------------------------------- # * Cursor Rectangle Update #-------------------------------------------------------------------------- def update_cursor_rect if @index < 0 self.cursor_rect.empty else self.cursor_rect.set(0, @index * 116, self.width - 32, 96) end end end |
| | | Magicalichigo Ancienne staffeuse
Messages postés : 4252 Date d'inscription : 02/08/2011 Jauge LPC :
| Sujet: Re: [XP] MENU G Mer 18 Déc 2013 - 20:58 | |
| Par ailleurs, tu ne peux pas dire que tu as créé un script si tu t'es juste contenté de le modifier, merci de rajouter le pseudo de ceux a qui tu empreintes leurs scripts dans les crédits. |
| | | eddy_de_galdon Chevalier Dragon (niveau 2)
Messages postés : 807 Date d'inscription : 31/08/2013 Jauge LPC :
| Sujet: Re: [XP] MENU G Mer 18 Déc 2013 - 21:14 | |
| donc pour le script de la transparence, ok. |
| | | eddy_de_galdon Chevalier Dragon (niveau 2)
Messages postés : 807 Date d'inscription : 31/08/2013 Jauge LPC :
| Sujet: Re: [XP] MENU G Mar 31 Déc 2013 - 17:42 | |
| 31.12.2013 Correction d'un bug "quand on mettait QUITTER, il y avait un bug de script" |
| | | eddy_de_galdon Chevalier Dragon (niveau 2)
Messages postés : 807 Date d'inscription : 31/08/2013 Jauge LPC :
| Sujet: Re: [XP] MENU G Jeu 16 Jan 2014 - 18:35 | |
| MAJ DU 16.01.2014 : Rajout de l'EXP aperçu sans scirpt de barre : aperçu avec script de barre : |
| | | Zexion Administrateur
Messages postés : 6228 Date d'inscription : 04/01/2012 Jauge LPC :
| Sujet: Re: [XP] MENU G Jeu 16 Jan 2014 - 23:16 | |
| Sympa, mais à ta place, je soustrairais l'IP requise pour le niveau précédent des deux nombres, histoire de ne pas avoir des nombres aussi gigantesques. |
| | | eddy_de_galdon Chevalier Dragon (niveau 2)
Messages postés : 807 Date d'inscription : 31/08/2013 Jauge LPC :
| Sujet: Re: [XP] MENU G Ven 17 Jan 2014 - 6:51 | |
| je vais essayer d'inclure un script de barre directement dans le menu G. mais ça va etre dûr ! |
| | | eddy_de_galdon Chevalier Dragon (niveau 2)
Messages postés : 807 Date d'inscription : 31/08/2013 Jauge LPC :
| Sujet: Re: [XP] MENU G Mer 19 Fév 2014 - 19:05 | |
| MAJ 19/02/14 : position des fentres pas, argent ettemps de jeu au hasard a chaque lancement du menu (les coordonées mise ne rentreront jamais avec le Window_Statut |
| | | Contenu sponsorisé
| Sujet: Re: [XP] MENU G | |
| |
| | | |
Sujets similaires | |
|
| Permission de ce forum: | Vous ne pouvez pas répondre aux sujets dans ce forum
| |
| |
| |