Damn, I thought I had the code. This is what I am using:
#==============================================================================
# Window_Horizontal
#==============================================================================
class Window_Horizontal < Window_Base
attr_reader :commands
def initialize(w, commands)
super(0, 0, 3 * w + 32, 64)
@item_max = commands.size
@commands = commands
if @item_max > 0
self.contents = Bitmap.new((@item_max + 4) * w, height - 32)
else
self.contents = Bitmap.new(32, height - 32)
end
@dir = 0
self.contents.font.name, self.contents.font.size = 'Brush Script', 26
self.opacity = self.index = 0
refresh
end
def refresh
self.contents.clear
(0...@item_max+4).each {|i| draw_item(i, (i + @item_max - 2) % @item_max)}
end
def get_command
return @commands[(@index + @item_max) % @item_max]
end
def draw_item(i, index, color = nil)
rect = Rect.new((self.width - 32)/3 * i, 0, (self.width - 32)/3, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
if color.is_a?(Color)
self.contents.font.color = color
else
self.contents.font.color = case @commands[index]
when 'And again!', 'Und nochmal!' then text_color(3)
when 'Warrior', 'Krieger' then text_color(6)
when 'Exerion' then text_color(2)
when 'Options', 'Optionen' then text_color(1)
when 'Debug Room' then text_color(8)
when 'Lost Memories', 'Erinnerungen' then text_color(9)
when 'Hexahax' then Color.new(0, 192, 255)
when 'Lexima One' then Color.new(0, 255, 96)
else
normal_color
end
end
self.contents.draw_text_outline(rect, @commands[index], 1)
end
def disable_item(index)
draw_item((index + 2) % @item_max, index, disabled_color)
draw_item((index + 2) % @item_max + @item_max, index, disabled_color)
draw_item((index + 2) % @item_max + @item_max*2, index, disabled_color)
end
def size
return @commands.size
end
def update
super
if moving?
case @dir.abs
when 1 then self.ox -= 5 * @dir.sgn
when 2 then self.ox -= 10 * @dir.sgn
when 3 then self.ox -= 20 * @dir.sgn
when 4 then self.ox -= 45 * @dir.sgn
when 5 then self.ox -= 45 * @dir.sgn
when 6 then self.ox -= 20 * @dir.sgn
when 7 then self.ox -= 10 * @dir.sgn
when 8 then self.ox -= 5 * @dir.sgn
end
@dir -= @dir.sgn
end
if !moving? && self.active && @item_max > 0
if Input.repeat?($controls.right)
$game_system.se_play($data_system.cursor_se)
@index = @index % @item_max + 1
if self.ox == (@item_max + 1)* (self.width - 32)/3
self.ox -= @item_max * (self.width - 32)/3
@index = 1
end
@dir = -8
elsif Input.repeat?($controls.left)
$game_system.se_play($data_system.cursor_se)
@index = (@index + @item_max - 2) % @item_max + 1
if self.ox == (self.width - 32)/3
self.ox += @item_max * (self.width - 32)/3
@index = @item_max - 1
end
@dir = 8
end
end
update_cursor_rect
end
def moving?
return (@dir != 0)
end
def index=(index)
@index = index
self.ox = (index + 1) * (self.width - 32)/3
update_help if self.active && @help_window != nil
update_cursor_rect
end
def update_cursor_rect
self.cursor_rect.set((self.width - 32)/3, 0, (self.width - 32)/3, 32)
end
end
But it's the command window that moves around as well. Hm... I remember somebody posting a horizontal command window at the old CP forum. You could try looking for it there.