2D Toolkit Forum

2D Toolkit => Support => Topic started by: hromoydron on July 28, 2013, 03:37:30 pm

Title: 2cameras for UI
Post by: hromoydron on July 28, 2013, 03:37:30 pm
Hello!

I need to use two cameras for UI.
But tk2UIManager can contain only one camera. And tk2UIManager can be only one.

What should I do?
Title: Re: 2cameras for UI
Post by: unikronsoftware on July 28, 2013, 03:53:05 pm
Is there any particular reason you NEED 2 cameras?
You're right, there can be only one UIManager - the system was designed that way to avoid having multiple managers - more things could go wrong that way.
Title: Re: 2cameras for UI
Post by: x8105 on July 28, 2013, 06:56:20 pm
I have 2 monitors for my ui, where all the colliders are on 1 layer and in the camera view, the 2nd is just viually displaying the info at a further back Z. Innefficient I know, Easy to know where things are,,, to an extent
Title: Re: 2cameras for UI
Post by: unikronsoftware on July 28, 2013, 08:14:42 pm
It doesn't support it at the moment. If all the colliders are only in one camera, then you will only need to use that camera with the manager - basically, the UIManager needs to know which camera to fire the ray from, and the ray has to hit colliders there.
Title: Re: 2cameras for UI
Post by: hromoydron on July 30, 2013, 12:25:33 pm
I have static buttons and buttons on the map. Map is bigger than screen, so I can drag and drop it with buttons on it(I simply move camera).
So I use one camera for static buttons over the map and second camera for map and buttons on it.

That's why I need it.

But now I understand. Instead moving a camera. I can move a game object with map and button on it.
But I am afraid of productivity(performance). There are One big map , 20-30 buttons, and 20 small animated sprites.
I make a game for IOS. I am far away from productivity test, but I afraid of lags, if I will move all these objects.

What can you say?
Is moving all objects harder for system than moving a camera or no?
Title: Re: 2cameras for UI
Post by: unikronsoftware on July 30, 2013, 12:28:04 pm
30 objects isn't exactly a lot though. I suggest picking the easiest solution first, and optimize later if necessary. Moving objects is possibly a bit more expensive than the camera, if the object has children in the hierarchy, but I doubt you'd notice with 20-30 objects
Title: Re: 2cameras for UI
Post by: hromoydron on July 30, 2013, 12:46:14 pm
Ок.Thanks for the advice)