Author Topic: Evenly spacing N number of UISprites on a UIWidget  (Read 3561 times)

andrew2110

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
Evenly spacing N number of UISprites on a UIWidget
« on: July 23, 2014, 02:00:52 PM »
Hello all,

I have had a look around the forums first as I believe that this must have been answered many times but haven't been able to find anything yet.

My question is regarding how to space N number of UI Sprites on a container evenly. For example I have a moves bar which has 4 buttons on it. I would like these 4 buttons to fill the entire move bar, with even spacing regardless of screen resolution. I've done a few experiments using the anchoring system but no luck in getting anything perfect just yet. If anyone can point me in the right direction, that would be appreciated.


andrew2110

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
Re: Evenly spacing N number of UISprites on a UIWidget
« Reply #1 on: July 23, 2014, 03:50:50 PM »
After further searching, it seems that the "custom" anchoring property is what we were after. I hadn't realised that this meant setting the size to a percentage of the space available, which is exactly what I wanted.