Totone Dieu Fondateur
Nombre de messages : 262 Localisation : Boulgourville, la Cité Perdue. Date d'inscription : 22/01/2006
| Sujet: [Mod'Menu] Dim 12 Fév - 23:52 | |
| Ce script permet "tout simplement" d'agrandir les commandes dans le menu lorsque le curseur se trouve dessus ! Sympa, ça ajoute un petit effet. Créez un nouveau scrîpt au-dessus de Main, le nom importe peu. Code : - Code:
-
#============================================================================== class Window_Command < Window_Selectable def initialize(width, commands) super(0, 0, width, commands.size * 32 + 32) @item_max = commands.size @commands = commands self.contents = Bitmap.new(width - 32, @item_max * 32) @item = [] self.index = 0 refresh @oldindex = 0 end #-------------------------------------------------------------------------- def refresh self.contents.clear for i in 0...@item_max if i != self.index draw_item_dis(i) else draw_item_active(i,@item[i]) end end end #-------------------------------------------------------------------------- # colors and font name etc. #--------------------------------------------------------------------------
def draw_item_dis(index) self.contents.font.name = "Arial" self.contents.font.size -= 2 self.contents.font.color = disabled_color rect = Rect.new(4+16, 32 * index, self.contents.width - 24, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) self.contents.draw_text(rect, @commands[index]) self.contents.font.size += 2 end def draw_item_active(index, type) self.contents.font.name = "Arial" self.contents.font.color = Color.new(0,0,0,255) self.contents.draw_text(5,32*index+1,self.contents.width,32, @commands[index]) if type==1 self.contents.font.color = disabled_color else self.contents.font.color = Color.new(255,255,220,255) end self.contents.draw_text(4,32*index,self.contents.width,32, @commands[index]) end #-------------------------------------------------------------------------- # index #-------------------------------------------------------------------------- def disable_item(index) @item[index] = 1 end
#-------------------------------------------------------------------------- # update #-------------------------------------------------------------------------- def update super #——refresh if self.index != @oldindex @oldindex = self.index refresh end end end A essayer d'urgence ! | |
|