Hello Guest

Author Topic: tk2dUIManager camera - separate camera?  (Read 5640 times)

midasmax

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 31
    • View Profile
tk2dUIManager camera - separate camera?
« on: July 10, 2013, 01:34:01 pm »
Hey everyone,

I'm getting started with using tk2dUI for handling GUIs. Based on the documentation online, it makes use of an Orthographic camera. I'm currently using a tk2dCamera to handle everything on my scene, and if I use thattogether with a BasicButton everything works.

But if i create a separate Orthographic camera, the button no longer responds to clicks. I was wondering if that's even necessary in the first place (having a separate camera), and if so, what is the best practice for doing so?

Thanks!

n3rdloop

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 47
    • View Profile
Re: tk2dUIManager camera - separate camera?
« Reply #1 on: July 10, 2013, 01:41:44 pm »
You need a UI Manager (created via tk2d menu) in your scene to handle the tk2d gui items. Assign your current camera to the public variable in the UI manager.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: tk2dUIManager camera - separate camera?
« Reply #2 on: July 10, 2013, 02:48:02 pm »
You don't NEED a separate ortho camera, as long as you're willing to resize the sprites and controls correctly. Basically - the included templates are set up to work with a normal camera, ortho size 1 out of the box.

You can mix and match and use the same tk2dCamera too, should you choose to do so.

midasmax

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 31
    • View Profile
Re: tk2dUIManager camera - separate camera?
« Reply #3 on: July 11, 2013, 05:20:03 am »
Thank you to both of you for your advice!

I think I've gotten the hang of it! The demos certainly helped a lot!