KireSerdnaSáb Jun 23, 2012 5:16 pm
Administrador
Script que permite resaltar la opción que uno escoge, es bien simple solo lo pones encima de main.
- Código:
==============================================================================
# Reruri-Chan : don't forgett the credits -.-
# Gato : 0.o it would be really better for you if you don't forgett them XD
# Carol13 : yes! >.<
#==============================================================================
# ¦ Make a new event call it like you want.. for
# example RgC
# Reruri-Chan Gato Carol
# Roling Games Cops *löl*
#------------------------------------------------------------------------------
# Shouting! >.<
# By Reruri-Chan , Gato , and Carol13
#==============================================================================
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