Hello Guest

Author Topic: 2cameras for UI  (Read 7209 times)

hromoydron

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 28
    • View Profile
2cameras for UI
« 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?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2cameras for UI
« Reply #1 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.

x8105

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 85
    • View Profile
Re: 2cameras for UI
« Reply #2 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

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2cameras for UI
« Reply #3 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.

hromoydron

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: 2cameras for UI
« Reply #4 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?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2cameras for UI
« Reply #5 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

hromoydron

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: 2cameras for UI
« Reply #6 on: July 30, 2013, 12:46:14 pm »
Ок.Thanks for the advice)