Author Topic: Using NGUI-Components in a different layer?  (Read 1375 times)

BehindTheStone

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 135
    • View Profile
Using NGUI-Components in a different layer?
« on: January 27, 2014, 01:52:19 PM »
Hey there,

(Using the latest NGUI Version)

In older Versions, like NGUI 2.X, it was possible to use the components on empty GameObjects in different layers and not the specific created Layer for the UI.

Now, when I create an empty GameObject and attach any NGUI-Component it automatically is made a child of my UIRoot and changes immediately the Layer from Default to my GUI-Layer.
I would like to use some Components from NGUI IN my Default-Layer like the Label-Component to write some Text in the Level.

A nice solution to this?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Using NGUI-Components in a different layer?
« Reply #1 on: January 27, 2014, 06:41:37 PM »
You need to have a panel present. If there is no panel, NGUI reparents it to the first panel it finds (which is usually the one on the UIRoot).

So first add a panel, then add a widget child to it.