Forum rules - please read before posting.

Menu Elements Alignment Explanation needed?

edited October 2014 in Engine development
Hello,

I have a menu let's say 400 width 200 height,

I have 4 buttons now in the menu with 0 spacing, as well aligned, each button's width is 60, this I'd assume now the buttons would be aligned this way: button 1 button 2 button 3 button 4, because it should fit on the 1st row on the menu and they should all be at the same height (y position) just different position in the x axis, but this is not the case and I couldn't figure out why, is this a limitation to AC how it treats ea element? should it not fit them all before it continues to either place them vertically or horizontally depending on what you have the menu setup as?

This option would be really helpful especially if I'm trying to add a bunch of mathematically calculated buttons with the same widths etc,


thanks.

Comments

  • edited October 2014
    Automatic alignment only works when the Position field of an element is set to Aligned, because you're otherwise setting it's position value explicitly.  If you want to align elements up this way, set their Position to Aligned, and increase the Menu's Spacing value.  The demo game's Pause menu, as an example, is set up this way.
  • edited October 2014
    Indeed that is what I thought, here is what I'm getting at:

    Menu Setup:

    Element orientation: Horizontal
    Position: Aligned
    Alignment: Middle Center
    Size: Manual (I only want it to reach up to certain parts on the screen)

    The width basically allows for 3 buttons per horizontal row and the height as well for 3 buttons per vertical row, and I was under the impression once the buttons reach the end of the menu they will be placed now underneeth the first row of buttons, and continue horizontally, instead the effect I get is the buttons continue horizontally (off menu width / screen) and therefore they are not visible to the menu when realistically 9 buttons should fit on that menu only 3 do because they do not align properly - as per menu width, why would it continue to go horizontally when there is no more space left? I'm just confused, I don't think it would make sense to make 3 menus to reach this effect? 

    Maybe I'm not catching things here, the buttons are set as automatic alignment just a set width/height

    I'm not really trying to specify where the buttons are position wise they are automatic alignment - I just want them aligned automatically properly

    Thanks 


  • No, it doesn't work like that - generally, the Menu's size is also set to Automatic - so that the entire Menu scales as more elements are added.

    If your Menu's Size is Manual, you can just set the Element's Position to Relative To Menu Size, allowing you to place elements down as a decimal of the total width or height (e.g. positioned 0.1 across, 0.2 down).

    This way, you can arrange elements in a grid by sharing the position data - e.g. a grid of 2x2 could be (0.1, 0.1), (0.1, 0.4), (0.4, 0.1), (0.4, 0.4)
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.