GameObject grouping, distributing and alignment

When making UI, I’m often trying to:

  • distribute sprites/buttons evenly within a designated space
  • align group of game objects within a designated space

Eg. Create multiple buttons and distribute them evenly, horizontally (so the space between them is equal, and this space is calculated based on how big the area we distribute them in is). Then align this group center top of the screen.

I tried using a Zone, but that has no children, while Group is not a GameObject you can align.

Sure, I can calculate and position these, I’m just wondering if any functionality already exists (ie. Phaser CE has group.align)

Here are some 3rd party ui plugins.
For the question of game objects alignment

  • Align game objects in a line
  • Align game objects in a circle
  • Align game objects in grids
1 Like

See http://phaser.io/examples/v3/view/actions/grid-align and http://phaser.io/examples/v3/category/display/align.