Author Topic: [RESOLVED] Help with my menu  (Read 3903 times)

Offline Ryex

  • Arctic Bird of Programming
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 5135
  • LV: 198
  • Gender: Female
  • Wants to write a compiler for fun
    • View Profile
[RESOLVED] Help with my menu
« on: March 22, 2008, 05:28:45 PM »
Well after weeks of trying I still don’t get it. I’ve fooled around long enough. I’m trying to turn the command window in to a bar that displays the commands horizontally but I can’t seem to do it. I can add the columns but I can’t get the commands the display in another column.

can some one help?

basicly it will look like this

I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.

DropBox, the best free file syncing service there is.
(click to show/hide)

Offline Juan

  • Ethereal Devastator
  • ****
  • Posts: 409
  • LV: 48
  • Gender: Male
  • Evil Twin
    • View Profile
Re: Help with my menu
« Reply #1 on: March 22, 2008, 05:46:09 PM »
I suggest making a command window based off the shop command window. If you want I'll script the commands for you.
Dropbox Who need luck when you can make your own.
(click to show/hide)

Offline Ryex

  • Arctic Bird of Programming
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 5135
  • LV: 198
  • Gender: Female
  • Wants to write a compiler for fun
    • View Profile
Re: Help with my menu
« Reply #2 on: March 23, 2008, 01:49:03 AM »
I've looked ate all the selectable windows that display things in more that one column but I can't figure it out. If perhaps you or some one else could make a very simple window example with two windows that are identical except on is vertical and the other in horizontal I would be able to figure it out exspsualy if you explained the difference in santax.

please help me!

I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.

DropBox, the best free file syncing service there is.
(click to show/hide)

Offline Juan

  • Ethereal Devastator
  • ****
  • Posts: 409
  • LV: 48
  • Gender: Male
  • Evil Twin
    • View Profile
Re: Help with my menu
« Reply #3 on: March 23, 2008, 09:44:47 AM »
I'll make it on monday since the computer at my dads doesn't have rpg maker xp and a limited user.
Dropbox Who need luck when you can make your own.
(click to show/hide)

Offline Ryex

  • Arctic Bird of Programming
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 5135
  • LV: 198
  • Gender: Female
  • Wants to write a compiler for fun
    • View Profile
Re: Help with my menu
« Reply #4 on: March 24, 2008, 07:01:26 PM »
thanks!
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.

DropBox, the best free file syncing service there is.
(click to show/hide)

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20016
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: Help with my menu
« Reply #5 on: March 25, 2008, 05:44:56 PM »
So basically a horizontal command window?
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline Ryex

  • Arctic Bird of Programming
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 5135
  • LV: 198
  • Gender: Female
  • Wants to write a compiler for fun
    • View Profile
Re: Help with my menu
« Reply #6 on: March 25, 2008, 06:10:29 PM »
yep

I cant get it ot go horizontal thats my problem
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.

DropBox, the best free file syncing service there is.
(click to show/hide)

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20016
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: Help with my menu
« Reply #7 on: March 25, 2008, 06:35:30 PM »
Damn, I thought I had the code. This is what I am using:

Code: [Select]
#==============================================================================
# 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.
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline Fantasist

  • Lexima Warrior
  • *******
  • Posts: 2223
  • LV: 146
  • Gender: Male
    • View Profile
    • Blog
Re: Help with my menu
« Reply #8 on: March 25, 2008, 06:51:02 PM »
All the more better if it moves as well! I think GAX asked for this.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)

The best of freeware reviews: Gizmo's Freeware Reviews



Offline Ryex

  • Arctic Bird of Programming
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 5135
  • LV: 198
  • Gender: Female
  • Wants to write a compiler for fun
    • View Profile
Re: Help with my menu
« Reply #9 on: March 25, 2008, 07:06:49 PM »
so it is not a simmple edit of the origanal Window_command class to make it display horizontaly?

oh and GAx did ask for a horizontal title command window for th title screen on the old fourms but I want the menu command window horizontal
« Last Edit: March 25, 2008, 07:09:33 PM by Ryex »
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.

DropBox, the best free file syncing service there is.
(click to show/hide)

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20016
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: Help with my menu
« Reply #10 on: March 25, 2008, 07:11:31 PM »
No, it's not. If i'm not wrong somebody posted a horizontal command window script first. You may wanna try RMRK, I think I saw that once there.

@FTS: You can't use it directly, you'll have to edit it. :P
Code: [Select]
Input.repeat?($controls.left)
« Last Edit: March 25, 2008, 07:12:21 PM by Blizzard »
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline Ryex

  • Arctic Bird of Programming
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 5135
  • LV: 198
  • Gender: Female
  • Wants to write a compiler for fun
    • View Profile
Re: Help with my menu
« Reply #11 on: March 25, 2008, 09:22:34 PM »
aaaaaa Found it!!!!

http://rmrk.net/index.php/topic,5889.msg56274.html

Tsunokiette made it.

it is a premade script that can creat the command window to you liking whtn you call it.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.

DropBox, the best free file syncing service there is.
(click to show/hide)

Offline Nortos

  • Has earned a custom title
  • Chaos User
  • ******
  • Posts: 1303
  • LV: 20
  • Gender: Male
  • Celestial Bomb my Digital Ass
    • View Profile
Re: Help with my menu
« Reply #12 on: March 25, 2008, 11:59:24 PM »
I did it I think for GAX on the old forums if there's a list of things you want horizontal you could just make another version of window_selectable and change the inputs
(click to show/hide)
Nortos's Stealth System
UltaFlame's Storyline Service
Blizz ABS - The Ultimate ABS!
My Resources

Offline Fantasist

  • Lexima Warrior
  • *******
  • Posts: 2223
  • LV: 146
  • Gender: Male
    • View Profile
    • Blog
Re: Help with my menu
« Reply #13 on: March 26, 2008, 02:16:18 PM »
@Bliz: lol! that's ONE of the many things. Do you mind if I edit it and use it?
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)

The best of freeware reviews: Gizmo's Freeware Reviews



Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20016
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: Help with my menu
« Reply #14 on: March 26, 2008, 07:30:22 PM »
No problem, be my guest.
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline Fantasist

  • Lexima Warrior
  • *******
  • Posts: 2223
  • LV: 146
  • Gender: Male
    • View Profile
    • Blog
Re: Help with my menu
« Reply #15 on: March 26, 2008, 07:31:56 PM »
Thank you :D
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)

The best of freeware reviews: Gizmo's Freeware Reviews



Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20016
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: Help with my menu
« Reply #16 on: April 05, 2008, 01:29:44 PM »
Just lol! I completely forgot that I have used a horizontal command windows in CoSLAL. Here you go:

Code: [Select]
#==============================================================================
# ** 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)
    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

As alternative you can use the horizontal window from the SDK:

Code: [Select]
#==============================================================================
# ** Window_HorizCommand
#------------------------------------------------------------------------------
#  This window deals with general command choices. (Horizontal)
#==============================================================================

class Window_HorizCommand < Window_Selectable
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader   :commands
  attr_accessor :c_spacing
  attr_accessor :alignment
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(width, commands, c_spacing = (width - 32) / commands.size)
    # Compute window height from command quantity
    super(0, 0, width, 64)
    @commands     = commands
    @item_max     = commands.size
    @column_max   = @item_max
    @c_spacing    = c_spacing
    @alignment    = 1
    self.contents = Bitmap.new(@item_max * @c_spacing, height - 32)
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # * Command
  #--------------------------------------------------------------------------
  def command(index = self.index)
    return @commands[index]
  end
  #--------------------------------------------------------------------------
  # * Commands
  #--------------------------------------------------------------------------
  def commands=(commands)
    # Return if Commands Are Same
    return if @commands == commands
    # Reset Commands
    @commands = commands
    # Resets Item Max
    item_max    = @item_max
    @item_max   = @commands.size
    @column_max = @item_max
    # If Item Max Changes
    unless item_max == @item_max
      # Deletes Existing Contents (If Exist)
      unless self.contents.nil?
        self.contents.dispose
        self.contents = nil
      end
      # Recreates Contents
      self.contents = Bitmap.new(@item_max * @c_spacing, height - 32)
    end
    # Refresh Window
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for i in 0...@item_max
      draw_item(i, normal_color)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #--------------------------------------------------------------------------
  def draw_item(index, color)
    command = commands[index]
    x = index * @c_spacing + 4
    self.contents.font.color = color
    self.contents.draw_text(x, 0, @c_spacing - 8, 32, command, @alignment)
  end
  #--------------------------------------------------------------------------
  # * Disable Item
  #--------------------------------------------------------------------------
  def disable_item(index)
    draw_item(index, disabled_color)
  end
  #--------------------------------------------------------------------------
  # * Cursor Rectangle Update
  #--------------------------------------------------------------------------
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
    else
      self.cursor_rect.set(@c_spacing * @index, 0, @c_spacing, 32)
    end
  end
end

Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.