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

● ARCHIVED · READ-ONLY
Started by EternalShadow 16 posts View original ↗
  1. 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.
  2. 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.
  3. 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
  4. Ah, awesome - thanks! 

    Something's gone a bit weird though:

    brbV2zz.png

    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)?
  5. 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.
  6. Zane said:
    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
  7. they are already pre made defs so just put it inside the script somewhere, but don't put it in another def lol
  8. First doesn't do anything, and second brings up an error that mentions a disposed bitmap?
  9. 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
  10. 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.

    I4SztGB.png

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

    This is the script:

    Spoiler
    #==============================================================================

    # ** 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

     
  11. 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?

    Spoiler
    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  
  12. Ah, that's awesome, thanks. One more thing though:

    cnmLIms.png

    The selector seems to extend far over the 'continue', 'new game', 'exit game' options - is there any way to center this selector as well? 
  13. 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.
  14. 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? ;_;
  15. 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.
  16. Sorry for late reply (no RM since the post above) but it's all sorted now, thanks :)