shin Chevalier Dragon (niveau 1)
Messages postés : 726 Date d'inscription : 18/10/2011 Jauge LPC :
| Sujet: Menu horizontal modifiable Sam 4 Mai 2013 - 1:20 | |
| Pas de commentaire sur le titre je savais pas quoi mettre Bon ce script est mon premier "officiel" (les autres étant tellement codés à l'arrache que je ne les est pas postés ^^) Le menu peut avoir 4 forme (modifiable dans les premières lignes) forme 1: simple face - Spoiler:
forme 2: chara - Spoiler:
form 3: face + chara - Spoiler:
form 4: picture (dimension 125*272) - Spoiler:
Ps: la 3eme picture ne correspond pas au perso mais j'avais que ça sous la main ^^ les icons en bas sont bien sur modifiable Script: - Code:
-
#=============================================================================== # Menu horizontal personalisable [VXA] # Version: 1.1 # Author: zibroph (LPDM => shin) # Date: 17 juillet 2013 #------------------------------------------------------------------------------- # Changelog : # # v 1.1 : si class sans mp la barre est retirée du menu #=============================================================================== module Menu_Perso #=============================================================================== # icon à coté de la somme d'argent #=============================================================================== ICON_GOLD = 2020 #=============================================================================== # icon à coté du nom de la map #=============================================================================== ICON_LIEU = 713 #=============================================================================== # icon à coté du temps de jeu #=============================================================================== ICON_TEMPO = 2256 #=============================================================================== # 4 possiblilitées : - :face affiche les faces des persos # - :picture affiche une image de dimension 125*272 # - :chara affiche le chara du perso # - :charaface affiche le face du perso et son chara #=============================================================================== STATUS_PICTURE = :face PICTURE = [] # pas touche #=============================================================================== # mettre le nom de l'image si vous avez choisi :picture #=============================================================================== PICTURE[1] = "actor1" PICTURE[2] = "actor2" PICTURE[3] = "actor3" PICTURE[4] = "actor4" end #=============================================================================== # FIN DE LA CONFIGURATION #===============================================================================
#=============================================================================== class Window_Base #=============================================================================== def draw_picture(picture_name, x, y, w, h, enabled = true) bitmap = Cache.picture(picture_name) rect = Rect.new(0, 0, w, h) contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha) bitmap.dispose end end
#=============================================================================== class Window_MenuCommand < Window_Command #=============================================================================== def window_width Graphics.width end #------------------------------------------------------------------------------- def visible_line_number return 2 end #------------------------------------------------------------------------------- def col_max 4 end #------------------------------------------------------------------------------- def alignment return 1 end #------------------------------------------------------------------------------- def spacing return 12 end #------------------------------------------------------------------------------- def refresh clear_command_list make_command_list create_contents super end end #=============================================================================== class Window_NewMenuStatus < Window_HorzCommand #=============================================================================== attr_reader :pending_index def initialize(x, y) @pending_index = -1 super(x, y) unselect deactivate end #------------------------------------------------------------------------------- def item_max $game_party.members.size end #------------------------------------------------------------------------------- def visible_line_number return 1 end #------------------------------------------------------------------------------- def col_max return 4 end #------------------------------------------------------------------------------- def window_width Graphics.width end #------------------------------------------------------------------------------- def window_height Graphics.height - fitting_height(4) end #------------------------------------------------------------------------------- def item_height height - standard_padding * 2 end #------------------------------------------------------------------------------- def current_item_enabled? return true end #------------------------------------------------------------------------------- def draw_item(index) actor = $game_party.members[index] enabled = $game_party.battle_members.include?(actor) rect = item_rect_for_text(index) draw_item_background(index) draw_actor_status(actor, rect.x, rect.y, item_width - end #------------------------------------------------------------------------------- def draw_actor_status(actor, x, y, width) case Menu_Perso::STATUS_PICTURE when :picture if (Menu_Perso::PICTURE[actor.id] != "") draw_picture( Menu_Perso::PICTURE[actor.id], (x + (width - 96)/2) - 15, 0, 125, item_height, width) else draw_actor_face( actor, x + (width - 96)/2, y + line_height * 1, width) end when :face draw_actor_face( actor, x + (width - 96)/2, y + line_height * 1, width) when :chara draw_actor_graphic( actor, x + 50, 85) when :charaface draw_actor_face( actor, x + (width - 96)/2, y + line_height * 1, width) draw_actor_graphic( actor, x + 100, 120) end draw_actor_name( actor, x, y + line_height * 0, width) y += 96 draw_actor_class(actor, x, y + line_height * 1, width) draw_actor_level(actor, x + width - 60, y + line_height * 2) draw_actor_hp( actor, x, y + line_height * 3, width) if actor.mmp != 0 draw_actor_mp( actor, x, y + line_height * 4, width) draw_actor_tp( actor, x, y + line_height * 5, width) else draw_actor_tp( actor, x, y + line_height * 4, width) end draw_actor_icons(actor, x, y + line_height * 5, width) end #------------------------------------------------------------------------------- def draw_item_background(index) if index == @pending_index contents.fill_rect(item_rect(index), pending_color) end end #------------------------------------------------------------------------------- def process_ok super $game_party.menu_actor = $game_party.members[index] end #------------------------------------------------------------------------------- def select_last select($game_party.menu_actor.index || 0) end #------------------------------------------------------------------------------- def pending_index=(index) last_pending_index = @pending_index @pending_index = index redraw_item(@pending_index) redraw_item(last_pending_index) end end
#=============================================================================== class Sprite_MenuBack < Sprite #=============================================================================== def initialize(viewport, x, y, h) super(viewport) self.x = x self.y = y self.bitmap = Bitmap.new(Graphics.width, h) self.bitmap.fill_rect(0, 0, Graphics.width, h, Color.new(0,0,0,128)) end end
#=============================================================================== class Window_Gold < Window_Base #=============================================================================== def icon draw_icon(Menu_Perso::ICON_GOLD, 0, 0) end #------------------------------------------------------------------------------- def refresh contents.clear icon draw_currency_value(value, currency_unit, 4, 0, contents.width - end end
#=============================================================================== class Window_Lieu < Window_Base #=============================================================================== def initialize(w) super( 0, 0, w, fitting_height(1)) refresh end #------------------------------------------------------------------------------- def icon draw_icon(Menu_Perso::ICON_LIEU, 0, 0) end #------------------------------------------------------------------------------- def refresh contents.clear icon contents.draw_text(0, 0, contents.width + 24, 25, $game_map.display_name, 1) end end
#=============================================================================== class Window_Temps < Window_Base #=============================================================================== def initialize(w) super(0, 0, w, fitting_height(1)) refresh end #------------------------------------------------------------------------------- def refresh contents.clear tempo = $game_system.playtime_s draw_icon(Menu_Perso::ICON_TEMPO, 0, 0) draw_text(0, 0, contents.width + 24, 25, tempo, 1) end end
#=============================================================================== class Scene_Menu < Scene_MenuBase #=============================================================================== def start super create_command_window create_gold_window create_status_window create_window_lieu create_window_temps end #------------------------------------------------------------------------------- def create_status_window @status_window = Window_NewMenuStatus.new(0, @command_window.height) end #------------------------------------------------------------------------------- def create_window_lieu @window_lieu = Window_Lieu.new(Graphics.width - (@gold_window.width * 2)) @window_lieu.x = @gold_window.width @window_lieu.y = Graphics.height - @gold_window.height end #------------------------------------------------------------------------------- def create_window_temps @window_temps = Window_Temps.new(@gold_window.width) @window_temps.x = @gold_window.width + @window_lieu.width @window_temps.y = Graphics.height - @gold_window.height end end
Dernière édition par shin le Mer 17 Juil 2013 - 11:15, édité 1 fois |
|
Slaizen Ancien staffeux
Messages postés : 520 Date d'inscription : 22/02/2012 Jauge LPC :
| Sujet: Re: Menu horizontal modifiable Sam 4 Mai 2013 - 10:05 | |
| Très intéressant le concept d'avoir plusieurs forme c'est bien pensé. Le script détaille bien ce qui est personnalisable et c'est facile à comprendre. Bref du bon travail, continue ainsi et merci du partage :p. |
|
RitoJS Ancien staffeux
Messages postés : 1925 Date d'inscription : 22/02/2012 Jauge LPC :
| Sujet: Re: Menu horizontal modifiable Sam 4 Mai 2013 - 10:55 | |
| Ouip, c'est pas mal du tout ! Merci du partage. |
|
Zexion Administrateur
Messages postés : 6228 Date d'inscription : 04/01/2012 Jauge LPC :
| Sujet: Re: Menu horizontal modifiable Sam 4 Mai 2013 - 11:16 | |
| Très sympathique, petite préférence pour le rendu face+chara. =) Je t'ajoute des points ! |
|
Delta Membre V.I.P.
Messages postés : 3126 Date d'inscription : 18/10/2011 Jauge LPC :
| Sujet: Re: Menu horizontal modifiable Sam 4 Mai 2013 - 12:49 | |
| |
|
shin Chevalier Dragon (niveau 1)
Messages postés : 726 Date d'inscription : 18/10/2011 Jauge LPC :
| Sujet: Re: Menu horizontal modifiable Mer 17 Juil 2013 - 11:19 | |
| Petit édit du script.
Retire la barre de mp si une class n'en possède pas.
|
|
Magicalichigo Ancienne staffeuse
Messages postés : 4252 Date d'inscription : 02/08/2011 Jauge LPC :
| Sujet: Re: Menu horizontal modifiable Mer 17 Juil 2013 - 11:23 | |
| C'est vraiment cool comme script j'aime beaucoup ^^ |
|
Zexion Administrateur
Messages postés : 6228 Date d'inscription : 04/01/2012 Jauge LPC :
| Sujet: Re: Menu horizontal modifiable Mer 17 Juil 2013 - 12:48 | |
| Merci pour la mise à jour. |
|
Heaven Chevalier Dragon (niveau 1)
Messages postés : 755 Date d'inscription : 01/04/2013 Jauge LPC :
| Sujet: Re: Menu horizontal modifiable Jeu 18 Juil 2013 - 18:00 | |
| J'ai pas vraiment compris comment on choisis le menu qu'on veut =/ J'ai beau lire les différentes explications, je ne parvient toujours pas à configurer ce script >.<
Heav'n |
|
Zexion Administrateur
Messages postés : 6228 Date d'inscription : 04/01/2012 Jauge LPC :
| Sujet: Re: Menu horizontal modifiable Jeu 18 Juil 2013 - 18:08 | |
| Ici je crois : - Code:
-
#=============================================================================== # 4 possiblilitées : - :face affiche les faces des persos # - :picture affiche une image de dimension 125*272 # - :chara affiche le chara du perso # - :charaface affiche le face du perso et son chara #=============================================================================== STATUS_PICTURE = :face Faut remplacer le "face" de la dernière ligne par le nom du menu que tu veux. |
|
Heaven Chevalier Dragon (niveau 1)
Messages postés : 755 Date d'inscription : 01/04/2013 Jauge LPC :
| Sujet: Re: Menu horizontal modifiable Jeu 18 Juil 2013 - 18:24 | |
| Ok, merci Zexion (:
Heav'n |
|
Contenu sponsorisé
| Sujet: Re: Menu horizontal modifiable | |
| |
|