Hello Guest

Author Topic: GUI Elements with Two Cameras  (Read 4747 times)

Matt-Cranktrain

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
GUI Elements with Two Cameras
« on: September 11, 2013, 02:14:19 pm »
Hi, I've got a tk2dCamera for viewing game sprites, and I'm making use of ZoomFactor to zoom in and out. However, when I add a UI element, or a TK2dTextMesh they get scaled down as well.

I've seen the occasional reference to creating another camera to use simultaneously, just to view interface objects alone, but I haven't been able to work out the proper configuration.

Can someone please step me through how that works?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: GUI Elements with Two Cameras
« Reply #1 on: September 11, 2013, 06:22:12 pm »
In 2D Toolkit 2.2, check demo 3 - 3D UI. That gives you an example of a 3D and 2D camera set up correctly. The thing that makes it work properly is the camera "Depth" property and the "Clear Flags".

Matt-Cranktrain

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: GUI Elements with Two Cameras
« Reply #2 on: September 12, 2013, 09:27:04 am »
That works wonderfully, thank you.