Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

New Game Title

Status
Not open for further replies.
Hmm..You want them in a horizontal window?
Add this above Main:
Code:
#==============================================================================
# ** Window_Horizantal
#------------------------------------------------------------------------------
#  This window deals with general command choices.
#==============================================================================

class Window_Horizantal < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     width    : window width
  #     commands : command text string array
  #--------------------------------------------------------------------------
  def initialize(commands,height=32)
    # Get biggest Item
    bitmap = Bitmap.new(1,1); sz = 0
    commands.each { |c|
      i = bitmap.text_size(c).width
      sz = i if i > sz
    }
    @mw = sz+16
    # Compute window height from command quantity
    super(0, 0, commands.size * @mw + 32,height+32)
    @item_max = commands.size
    @column_max = @item_max
    @commands = commands
    self.contents = Bitmap.new(@item_max * @mw,height)
    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
  #     color : text color
  #--------------------------------------------------------------------------
  def draw_item(index, color)
    self.contents.font.color = color
    rect = Rect.new(@mw * index, 4, @mw, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.draw_text(rect, @commands[index],1)
  end
  #--------------------------------------------------------------------------
  # * Cursor Rectangle Update
  #--------------------------------------------------------------------------
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
    else
      self.cursor_rect.set( @index * @mw, 4, @mw, self.height-32)
    end
  end
  #--------------------------------------------------------------------------
  # * Disable Item
  #     index : item number
  #--------------------------------------------------------------------------
  def disable_item(index)
    draw_item(index, disabled_color)
  end
end

Now, go to Scene_Title and edit:

    @command_window = Window_Command.new(192, [s1, s2, s3])

to

    @command_window = Window_Horizantal.new([s1, s2, s3])

Edit:

Oh..XD, my bad. I saw the

PRESS START BUTTON

and didn't read it, so I thought it was actually the command window XD
 
Status
Not open for further replies.

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top