Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: ProjectOne on February 04, 2013, 11:18:03 PM

Title: Can you have two UI ROOT(2D) and two cameras?
Post by: ProjectOne on February 04, 2013, 11:18:03 PM
HI,
I am using a UI Root(2D) with NGUI Camera to draw all layers and sprites for an object-layer based parallax scrolling 2D game (seen example from thinkscroller which indeed uses NGUI to draw sprites for such setup)

BUT I was thinking to separate pure UI elements like Score/Timers/Health,etc... to be on a different layer (NGUI layer) and have their own NGUI camera.
At the moment I have a NGUI Label on NGUI layer which is displayed by same camera that displays parallax scene.

Is it ok to create a New UI (from UI tool) which will come with his own UI Root(2D) - Camera - Panel... or is it the case that I can only have one UI Root(2D) in a scene?

Thanks
Title: Re: Can you have two UI ROOT(2D) and two cameras?
Post by: lime-green.at on February 05, 2013, 02:55:31 AM
Yeah, that works pretty well. If you dont need the anchor to clip to two different sides, you can just create a new panel in your already existing UI Root, if not, just duplicate the anchor with all its childs.

Regards
Title: Re: Can you have two UI ROOT(2D) and two cameras?
Post by: Nicki on February 05, 2013, 04:05:15 AM
I don't think you really gain much from making a secondary root, unless of course you want its virtual pixels to be a different size - that can lead to headaches though, so tread carefully. :)
Title: Re: Can you have two UI ROOT(2D) and two cameras?
Post by: ProjectOne on February 05, 2013, 06:00:32 AM
Thanks guys...

So maybe best option is to create a new panel under existing UI Root and have a camera with UI Camera just for content of this panel, so I can keep scene sprites and GUI stuff on separate cameras? But with one UI Root

Will try thanks