Hello Guest

Author Topic: tk2dCamera  (Read 4133 times)

Dipanker

  • Newbie
  • *
  • Posts: 17
    • View Profile
tk2dCamera
« 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.

unikronsoftware

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