i need help lining up this
the h command im using by blizzard
#==============================================================================
# ** Window_HCommand
#------------------------------------------------------------------------------
# This window deals with general command choices, but the display is
# horizontal.
#==============================================================================
class Window_HCommand < Window_Command
#--------------------------------------------------------------------------
# * Object Initialization
# width : window width
# commands : command text string array
#--------------------------------------------------------------------------
def initialize(width, commands)
super
self.width, self.height = commands.size * width + 32, 64
@column_max = commands.size
self.contents.dispose
self.contents = Bitmap.new(self.width - 32, self.height - 32)
refresh
update_cursor_rect
end
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
# color : text color
#--------------------------------------------------------------------------
def draw_item(i, color)
color = Color.new(100, 100, 255, 255)
self.contents.font.color = color
w = (self.width - 32) / @column_max
x = i % @column_max * w
rect = Rect.new(x, 0, self.contents.width / @column_max, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, @commands[i], 1)
end
#--------------------------------------------------------------------------
# * Update Cursor Rectangle
#--------------------------------------------------------------------------
def update_cursor_rect
# If cursor position is less than 0
if @index < 0
self.cursor_rect.empty
return
end
# Get current row
row = @index / @column_max
# If current row is before top row
if row < self.top_row
# Scroll so that current row becomes top row
self.top_row = row
end
# If current row is more to back than back row
if row > self.top_row + (self.page_row_max - 1)
# Scroll so that current row becomes back row
self.top_row = row - (self.page_row_max - 1)
end
# Calculate cursor width
cursor_width = (self.width - 32) / @column_max
# Calculate cursor coordinates
x = @index % @column_max * cursor_width
# Update cursor rectangle
self.cursor_rect.set(x, 0, cursor_width, 32)
end
end
and the code im trying to use
class Scene_Calander
###########################################################
def main
@calander = Sprite.new
@calander.bitmap = Bitmap.new("Graphics/Pictures/SPRING")
@command_window = Window_HCommand.new(50, ["", "", "", "", "", "", ""])
@command_window.x = 50
@command_window.y = 143
@command_window.opacity = 0
@command_window.index = 0
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@command_window.dispose
@calander.dispose
end
#####################################################3
def update
@command_window.update
if @command_window.active
update_command
return
end
end
###################################################
def update_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
if Input.trigger?(Input::C)
case @command_window.index
when 0
$game_system.se_play($data_system.decision_se)
when 1
$game_system.se_play($data_system.decision_se)
when 2
$game_system.se_play($data_system.decision_se)
when 3
$game_system.se_play($data_system.decision_se)
when 4
$game_system.se_play($data_system.decision_se)
when 5
$game_system.se_play($data_system.decision_se)
end
return
end
end
end