Is there a very simple script for horizontal commands in the title screen?

EternalShadow

Veteran
Veteran
Joined
Sep 16, 2012
Messages
5,781
Reaction score
1,041
First Language
English
Primarily Uses
All the scripts I've found require the addition of images and other complicated animations to the game to be able to use a simple horizontal command line in the title screen when all I want to do is have the text horizontally-aligned, not vertically-aligned.

Like:

New Game - Continue - Exit Game

instead of:

New Game

Continue

Exit Game

If a simple one could be made (Personally I'll be using it in the 2014 contest) or found, I'd greatly appreciate it!

Thanks.
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
15,353
Reaction score
8,532
First Language
English
Primarily Uses
RMMV
It's actually pretty easy to adjust. I know, I've figured that one out. If you go into scripts and find Window_TitleCommand. In the first line change it to

class Window_TitleCommand < Window_HorzCommand

You may have to play around to adjust the width of the menu (just a bit lower than that line), but it should work.
 

Zane

Food for thought
Veteran
Joined
Jun 9, 2013
Messages
913
Reaction score
110
First Language
US English
Primarily Uses
just put

def col_max ; return item_max end

somewhere inside the script

and then change window width to whatever it needs to be.

Edit: Ninja'd by mlogan =P
 
Last edited by a moderator:

EternalShadow

Veteran
Veteran
Joined
Sep 16, 2012
Messages
5,781
Reaction score
1,041
First Language
English
Primarily Uses
Ah, awesome - thanks! 

Something's gone a bit weird though:



How would one fix the width of the letters to not be so scrunched up, and can they be centered in their respective columns so that they don't all go toward the left of their own column (as a gap is left on the right)?
 

Zane

Food for thought
Veteran
Joined
Jun 9, 2013
Messages
913
Reaction score
110
First Language
US English
Primarily Uses
This centers it

def alignment ; return 1 end

if the window width isn't changing the size then do this

def item_width ; return (contents.width / 3)  - standard_padding * 2 end

that would definatly work.
 

EternalShadow

Veteran
Veteran
Joined
Sep 16, 2012
Messages
5,781
Reaction score
1,041
First Language
English
Primarily Uses
This centers it

def alignment ; return 1 end

if the window width isn't changing the size then do this

def item_width ; return (contents.width / 3)  - standard_padding * 2 end

that would definatly work.
Sorry, where do I put either line? XD
 

Zane

Food for thought
Veteran
Joined
Jun 9, 2013
Messages
913
Reaction score
110
First Language
US English
Primarily Uses
they are already pre made defs so just put it inside the script somewhere, but don't put it in another def lol
 

EternalShadow

Veteran
Veteran
Joined
Sep 16, 2012
Messages
5,781
Reaction score
1,041
First Language
English
Primarily Uses
First doesn't do anything, and second brings up an error that mentions a disposed bitmap?
 

Zane

Food for thought
Veteran
Joined
Jun 9, 2013
Messages
913
Reaction score
110
First Language
US English
Primarily Uses
The first one centers the commands to what the real window would be. Are you using a custom script or is this for the default one? I'll write a new script up when I get home if you would like. I just need to know if your using a special title screen already
 

EternalShadow

Veteran
Veteran
Joined
Sep 16, 2012
Messages
5,781
Reaction score
1,041
First Language
English
Primarily Uses
I was using a custom one (Zerbu engine) but removed it due to a script clash. The script it clashed with has also been removed though.

So basically, I'm not using anything special with the title screen at the moment apart from your/Mlogan's two lines.

I did some more fiddling and fixed the width - but centering still doesn't occur, and there remains the bitmap error.



That's the best I can get it to look like for now.

This is the script:

#==============================================================================

# ** Window_TitleCommand

#------------------------------------------------------------------------------

#  This window is for selecting New Game/Continue on the title screen.

#==============================================================================

 

class Window_TitleCommand < Window_HorzCommand

  

def alignment ; return 1 end

 

  

  

  #--------------------------------------------------------------------------

  # * Object Initialization

  #--------------------------------------------------------------------------

  def initialize

    super(0, 0)

    update_placement

    select_symbol:)continue) if continue_enabled

    self.openness = 0

    open

  end

  #--------------------------------------------------------------------------

  # * Get Window Width

  #--------------------------------------------------------------------------

  def window_width

    return 500

  end

  #--------------------------------------------------------------------------

  # * Update Window Position

  #--------------------------------------------------------------------------

  def update_placement

    self.x = (Graphics.width - width) / 2

    self.y = (Graphics.height * 1.6 - height) / 2

  end

  #--------------------------------------------------------------------------

  # * Create Command List

  #--------------------------------------------------------------------------

  def make_command_list

    add_command(Vocab::new_game, :new_game)

    add_command(Vocab::continue, :continue, continue_enabled)

    add_command(Vocab::shutdown, :shutdown)

  end

  #--------------------------------------------------------------------------

  # * Get Activation State of Continue

  #--------------------------------------------------------------------------

  def continue_enabled

    DataManager.save_file_exists?

  end

end

 
 

SoulPour777

Crownless King
Veteran
Joined
Aug 15, 2012
Messages
1,093
Reaction score
104
First Language
English
Primarily Uses
N/A
You changed the inherited methods from the TitleCommand, its a super class mismatch. Also, instead of changing the alignment, should it not be better to add the column max or change the column max instead?

Code:
#==============================================================================# ** Window_TitleCommand#------------------------------------------------------------------------------#  This window is for selecting New Game/Continue on the title screen.#============================================================================== class Window_TitleCommand < Window_Command    def col_max    return 3  end    def window_height    return 50  end  #--------------------------------------------------------------------------  # * Object Initialization  #--------------------------------------------------------------------------  def initialize    super(0, 0)    update_placement    select_symbol(:continue) if continue_enabled    self.openness = 0    open  end  #--------------------------------------------------------------------------  # * Get Window Width  #--------------------------------------------------------------------------  def window_width    return 500  end  #--------------------------------------------------------------------------  # * Update Window Position  #--------------------------------------------------------------------------  def update_placement    self.x = (Graphics.width - width) / 2 + 15    self.y = (Graphics.height * 1.6 - height) / 2  end  #--------------------------------------------------------------------------  # * Create Command List  #--------------------------------------------------------------------------  def make_command_list    add_command(Vocab::new_game, :new_game)    add_command(Vocab::continue, :continue, continue_enabled)    add_command(Vocab::shutdown, :shutdown)  end  #--------------------------------------------------------------------------  # * Get Activation State of Continue  #--------------------------------------------------------------------------  def continue_enabled    DataManager.save_file_exists?  endend  
 

EternalShadow

Veteran
Veteran
Joined
Sep 16, 2012
Messages
5,781
Reaction score
1,041
First Language
English
Primarily Uses
Ah, that's awesome, thanks. One more thing though:



The selector seems to extend far over the 'continue', 'new game', 'exit game' options - is there any way to center this selector as well? 
 

SoulPour777

Crownless King
Veteran
Joined
Aug 15, 2012
Messages
1,093
Reaction score
104
First Language
English
Primarily Uses
N/A
You'll need to get the item_rect method which draws the rectangle to select the items which is drawn from the Window_Selectable. For example, adding this on your code:

#-------------------------------------------------------------------------- # * Get Rectangle for Drawing Items #-------------------------------------------------------------------------- def item_rect(index) rect = Rect.new rect.width = item_width - 10 rect.height = item_height rect.x = index % col_max * (item_width + spacing) rect.y = index / col_max * item_height rect end you can play around the dimensions (width and height) and location (x and y) of the rect class on your code. This on any means will only change its measurements on the Window_TitleCommand where you placed the code. It would revert back to the usual item_rect once you get out from there.
 

EternalShadow

Veteran
Veteran
Joined
Sep 16, 2012
Messages
5,781
Reaction score
1,041
First Language
English
Primarily Uses
I honestly must be doing something wrong here, sorry :|

I've tried fiddling with the code given, and it just gives me an effect similar to the first post. If I try to modify other aspects of the code to fix this, it just moves the commands and not the rectangle itself. 

Can I please send the project to someone to have a look at this? ;_;
 

SoulPour777

Crownless King
Veteran
Joined
Aug 15, 2012
Messages
1,093
Reaction score
104
First Language
English
Primarily Uses
N/A
Because the cursor and the item_rect follows the commands, you can not make the cursor off the commands, not unless the commands is moved or that the item_rect is changed. The best way you can do for this to remove the excess lines in the rectangle is to decrease its width to 45, that way, all other items on the command are selected properly.
 

EternalShadow

Veteran
Veteran
Joined
Sep 16, 2012
Messages
5,781
Reaction score
1,041
First Language
English
Primarily Uses
Sorry for late reply (no RM since the post above) but it's all sorted now, thanks :)
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c

Forum statistics

Threads
105,857
Messages
1,017,018
Members
137,563
Latest member
MinyakaAeon
Top