Hello Guest

Author Topic: When to use TK2Camera?  (Read 5914 times)

paulhocker

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 22
    • View Profile
    • SpockerDotNet LLC
When to use TK2Camera?
« on: February 24, 2013, 05:50:18 pm »
Is it safe to say that one should only use TK2Camera for GUI elements of a game? I have had all kinds of "placement" trouble with the camera using it as my main game camera.

Thanks.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: When to use TK2Camera?
« Reply #1 on: February 24, 2013, 07:14:23 pm »
No, I think it is useful in a lot more cases than just for GUI. I'd use it in almost all cases, except maybe when I want a big world and don't want to deal with the tk2dcamera scale.

What sort of placement problems did you have with it?

phongtran72

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: When to use TK2Camera?
« Reply #2 on: March 15, 2013, 10:15:17 pm »
I have the same question. I cannot see 3d objects using TK2Camera. If I use the normal camera with the same setting, I can see them. I am sure I am missing somethings very basic here. Please help.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: When to use TK2Camera?
« Reply #3 on: March 15, 2013, 11:13:53 pm »
Each world unit = 1 pixel with the tk2dCamera. Your 3d object is likely to be microscopic with default scale settings.
You can scale it up, and it should be visible then. But keep in mind the tk2dCamera is orthographic, that might not be what you want with 3d objects...

phongtran72

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: When to use TK2Camera?
« Reply #4 on: March 16, 2013, 01:47:46 am »
I am learning from your new 2D UI toolkit, and I have problem with different resolutions. How can I display a button at a corner of the screen regardless resolution?
By the way, I very happy with your toolkit. Thanks for your hard work.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: When to use TK2Camera?
« Reply #5 on: March 16, 2013, 06:31:27 pm »
The UI stuff doesn't do anchors yet. That will be in a future update.
If you're using the tk2dCamera, you can simply use the tk2d camera anchor.

aportilla

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: When to use TK2Camera?
« Reply #6 on: March 22, 2013, 03:28:15 pm »
"Each world unit = 1 pixel with the tk2dCamera."

Why is this? And, can it be overwritten?

Thanks,
Alex

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: When to use TK2Camera?
« Reply #7 on: March 22, 2013, 04:06:29 pm »
"Each world unit = 1 pixel with the tk2dCamera."

Why is this? And, can it be overwritten?

Thanks,
Alex

That was a design decision with the tk2dCamera. It can't be changed.
However, you're free to use a normal ortho camera without the tk2dCamera. You can use any scale you want there.