Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: kretin on August 28, 2014, 09:43:26 PM

Title: 2D UI panel in strange place
Post by: kretin on August 28, 2014, 09:43:26 PM
I've just updated to the latest NGUI. Since then a 2D UI panel is behaving very strangely.

I have a 3D UI and a 2D UI working together, both with UIRoot and UIPanel. The 3D UI is will working fine.

The 2D panel itself appears at a strange location and rotation, and at a massive scale.
Elements positioned within the panel appear in the camera correctly.
Elements anchored to the panel don't appear in the camera view.

But everything appears correctly when the game is run.

I created a new panel and re-setup all the anchors which worked until I restarted the program, at which point the same problem occurred in the new panel.

Not being able to see what I'm doing during editing is making it very difficult. Any ideas?
Title: Re: 2D UI panel in strange place
Post by: ArenMook on August 28, 2014, 09:52:21 PM
Where is the panel located and what is it anchored to? The recommended UI hierarchy is:

UIRoot
- UICamera
- UIPanels
Title: Re: 2D UI panel in strange place
Post by: kretin on August 28, 2014, 11:28:59 PM
I have 2 lots of:

UIRoot (with UIPanel script on it)
- UICamera

I managed to get it working properly again by centering everything, putting UI's in their own layers, and adjusting settings having read another post with a similar problem. Only thing is I'm not sure exactly which adjustment worked...

thanks :)
Title: Re: 2D UI panel in strange place
Post by: ArenMook on August 30, 2014, 08:23:30 AM
Each UICamera needs its own layer, so your "putting UIs in their own layers" is what did it.
Title: Re: 2D UI panel in strange place
Post by: kretin on August 31, 2014, 01:24:17 AM
Gotcha. Thanks :)