2D Toolkit Forum

2D Toolkit => Support => Topic started by: Dipanker on July 19, 2013, 12:17:57 pm

Title: tk2dCamera
Post by: Dipanker on July 19, 2013, 12:17:57 pm
Hi, I want to apply 2dtk to display health and score above player in my game, but the point is that which camera should i use for UI manager and the problem is that, my game use perspective camera but 2D toolkit look weird in perspective view, I can display it by GUI but I want to use 2D Toolkit on it. So please help me on it.
Title: Re: tk2dCamera
Post by: unikronsoftware on July 19, 2013, 06:43:59 pm
You can create a second tk2dCamera for the score & health, and the rest of your GUI. Use camera culling masks to control what each camera sees. Refer to sample #6 - button and 3d sprites for an example of how you can do this.

You can resolve positions from one camera to another by using .camera.WorldToScreenPosition on the first camera, and ScreenToWorldPosition on the second.