Author Topic: Create second 2D UI or separate widget hierarchy?  (Read 4064 times)

kruncher

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 78
    • View Profile
Create second 2D UI or separate widget hierarchy?
« on: October 02, 2013, 08:23:24 AM »
I would like to adopt the following project structure:

GUI Root (used for GUI)
|---> HUD
|---> Main Menu

Scene Root (very basic 2D scene containing 1 background and several static sprites)
|---> Panel
|--------> Background

Where "GUI Root" is saved as a prefab and "Scene Root" is different on a per scene basis. Since this game is for mobile I want to avoid keeping redundant background textures in memory. Usage of NGUI would be useful since UIStretch is needed for the background.

Does anybody have any thoughts as to how I might achieve this?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Create second 2D UI or separate widget hierarchy?
« Reply #1 on: October 02, 2013, 05:22:26 PM »
Just use two UI setups, each on a different layer. I do that in Starlink with the 3D and 2D UIs.

kruncher

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 78
    • View Profile
Re: Create second 2D UI or separate widget hierarchy?
« Reply #2 on: October 02, 2013, 06:30:14 PM »
Awesome stuff, thanks! That was the missing link for me using a separate layer!

Btw, your Starlink game is really nice! I am going to get this on iOS. I hope that your sales are going well!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Create second 2D UI or separate widget hierarchy?
« Reply #3 on: October 03, 2013, 04:19:50 AM »
It pays for tea, but that's about it. :)