Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
Sign in to follow this  
Noob Saibot

Horizontal Command Window

Recommended Posts

Mad Klown has brought to you a script from SephirothSpawn which was originally posted on RMXPU.net before it died:

 

I was needing a Horizontal Command Window for a new script, so I made one. I decided to share it. It's nothing great, but works none the less.

 

 

#==============================================================================
# Window Horizontal Command
# Created By SephirothSpawn (11.03.05)
# Last Updated: 11.03.05
#==============================================================================

class Window_HorizCommand < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(commands, width = 640, height = 64)
super(0, 0, width, height)
self.contents = Bitmap.new(width - 32, height - 32)
@commands = commands
@item_max = @commands.size
@column_max = @commands.size
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@item_max
 draw_item(i)
end
end
#--------------------------------------------------------------------------
# * Draw Item
#  index : item number
#--------------------------------------------------------------------------
def draw_item(index)
width = self.width - 32
off = width / @item_max
x = 4 + index * off
self.contents.draw_text(x, 0, off - 32, 32, @commands[index])
end
#--------------------------------------------------------------------------
# * Disable Item
#  index : item number
#--------------------------------------------------------------------------
def disable_item(index)
draw_item(index, disabled_color)
end
end

 

How to Use:

Just pass arguements as you would for a regular Command Window.

 

window = Window_HorizCommand.new(commands, width, height)

 

*Note The Default for Both Width and Height are Default at 640 * 64

 

Original Post: RMXPU.net Archive

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...