Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Need help designing a dynamic UI button system

Discussion in 'Editor & General Support' started by Thimble2600, Jul 24, 2019.

  1. Thimble2600

    Thimble2600

    Joined:
    Nov 27, 2015
    Posts:
    165
    I'd like to make a UI system of buttons. There can be an infinite number of rows, each with an infinite number of columns. This is quite easy to achieve but I'm having a time deciding how to blend buttons together.

    I made some dumb little gif to demonstrate what I'm hoping to make. As buttons are added the surrounding segment of the button merges with its neighbour. This will hopefully reduce the amount of clutter on the screen as there are an enormous amount of actions the player can perform.


    Tile maps and rule tiles come to mind but that's a little over kill, and I'm pretty sure they wouldn't work in the Canvas.

    If anyone has any suggestions I'd love to hear them.

    My current plan is to instantiate an outer layer of images and have them swap to a sprite to reflect the layout of buttons. This seems pretty crude though, so I thought I'd make this post.