MasterMind
Member
I'm trying to make my own command window for horizontal icon commands. So far, I've gotten to this:
I'm trying to get it to look like this:
http://img224.imageshack.us/img224/9258 ... temgm7.png[/IMG]
The only problem so far, is that only one icon shows up. I have no clue where this error is coming from.
Code:
#==============================================================================
# Window Battle Command
#==============================================================================
class Window_BattleCommand < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(width = 160, icons = [])
super(0, 0, width, icons.size * 32 + 32)
self.contents = Bitmap.new(width - 32, height - 32)
@icons = icons
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i, normal_color)
end
end
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
#--------------------------------------------------------------------------
def draw_item(index, color)
y = index * 32
# Clears Area
self.contents.fill_rect(0, y, contents.width, 32, Color.new(0, 0, 0, 0))
# Draws Icon
bitmap = RPG::Cache.icon(@icons[index])
self.contents.blt(4, y + 4, bitmap, Rect.new(0, 0, 24, 24), color.alpha)
end
#--------------------------------------------------------------------------
# * Disable Item
# index : item number
#--------------------------------------------------------------------------
def disable_item(index)
draw_item(index, disabled_color)
end
end
I'm trying to get it to look like this:
http://img224.imageshack.us/img224/9258 ... temgm7.png[/IMG]
The only problem so far, is that only one icon shows up. I have no clue where this error is coming from.