Sobeman459
Member
I want to make a horizontal command winow but instead of commands i want to so 40x40 icons instead.Then is possible not needed the cursor underneth it. Thanks and if you need anything else explained just ask.
class Window_IconCommand < Window_Selectable
def initialize(height, icons)
super(0, 0, icons.size * 44 + 32, height)
self.contents = Bitmap.new(icons.size * 40, height - 32)
@column_max = icons.size
@item_max = icons.size
@icons = icons
self.index = 0
refresh
end
def refresh
self.contents.clear
for icons in @icons
bitmap = RPG::Cache.icon(icons)
x = @icons.index(icons) * 44
self.contents.blt(x, 0, bitmap, Rect.new(0, 0, 40, 40))
end
end
def update_cursor_rect
self.cursor_rect.set(self.index * 44 - 2, -2 , 44, 44)
end
end
class Scene_Something
alias old_main main
alias old_update update
def main
@icon1 = "001-Weapon01"
@icon2 = "002-Weapon02"
@icon3 = "003-Weapon03"
@icon_window = Window_IconCommand.new(72, [@icon1, @icon2, @icon3])
old_main
@icon_window.dispose
end
def update
@icon_window.update
old_update
end
end