Hello Guest

Author Topic: 2DTK Camera + Orthographic Size  (Read 5676 times)

tmountain

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 3
    • View Profile
2DTK Camera + Orthographic Size
« on: May 14, 2013, 07:07:15 pm »
Hi there,

Playing around with some ideas using 2DTK 1.92 Final + Patch 1. I've read the 2DTK camera docs and also a number of forum posts, so I'm aware of the downsides:

- currently theres a bug in unity which draws the camera preview window incorrectly.
- the same bug means the in-scene camera bounds drawing is wrong.

In my testing, using the 2DTK camera and changing the orthographic size seems to make no difference in the preview window (as stated above) or the game window. I.e., if I setup a standard orthographic camera and change the size to 30, everything becomes huge, but when using the 2DTK camera, nothing changes. In thinking that it's all related to preview related stuff, I tried building an executable, and again, no change regardless of the orthographic size. How can I make the 2DTK camera respect the orthographic size when playing my demo?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2DTK Camera + Orthographic Size
« Reply #1 on: May 14, 2013, 09:57:34 pm »
Hi,

You are aware of the 2 main issues.
The good news has as far as I am aware, fixed in Unity 4.2.
The second (bounds in scene) has been looked at and will likely get fixed in that version of Unity.

The tk2dCamera isn't an orthographic camera in the Unity sense of the word - it uses a custom projection matrix. (its an off center orthographic matrix) As you've found out, that isn't shown in the inspector. In any case - the tk2dCamera by default resizes itself so 1 world unit = 1 pixel. Having an orthographic size in that wouldn't really make sense.

If you need to use orthographic size, I suggest using a normal camera for now. 2D Toolkit 2.0 (or the first point release soon after) will have a tk2dOrthoCamera script which will bring all the rescaling goodness to a normal ortho camera. If you don't wish to update, you should be able to selectively import this script into your project.