Author Topic: How do I structure my UI?  (Read 3634 times)

leagueofmonkeys

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 20
    • View Profile
How do I structure my UI?
« on: July 03, 2013, 02:16:02 AM »
Hi :)

I have anchor_A which is anchored to screen top, it contains panel_A with sprite_A which stretches to fit the width of the screen using UIStretch.  I also have anchor_B(anchored to sprite_A left) which contains panel_B and anchor_C(anchored to sprite_A right) which contains panel_C.  How do I structure my UI? This is my current structure...

UIRoot
-UICamera

--anchor_A(anchored to screen top)
---panel_A
----sprite_A

--anchor_B(anchored to sprite_A left)
---panel_B

--anchor_C(anchored to sprite_A right)
---panel_C

What is the best approach for tweening this panel_A and its sub panels?  ...what about disabling and enabling the panel and it's subpanels?

Thanks for reading :)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How do I structure my UI?
« Reply #1 on: July 03, 2013, 05:56:51 AM »
I don't recommend doing this at all. Position your UI how you need it to be once and that's it. Making UIs that stretch and change dimensions properly is a pain, and is best achieved via custom code.

leagueofmonkeys

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 20
    • View Profile
Re: How do I structure my UI?
« Reply #2 on: July 03, 2013, 05:38:13 PM »
Thanks for your reply ArenMook :)

I need my UI to fit different screen aspect ratios and since my target is mobile devices I want to take advantage of all available screen space. Rather than using anchors to position the different elements of panel_A to the edges of that panel how do you recommend doing it?

What is the purpose of an anchor that anchors to widgets and panels if I'm not supposed to use it for that purpose?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How do I structure my UI?
« Reply #3 on: July 04, 2013, 08:16:49 AM »
It's for static UIs. You were asking about tweening, and tweening doesn't mix well with anchors that reposition elements themselves. You basically get conflicts.