Hello Guest

Author Topic: tk2d camera empty screen  (Read 3340 times)

wijesijp

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 10
    • View Profile
tk2d camera empty screen
« on: October 20, 2013, 05:44:12 am »
My game with normal camera is working well. Then I add tk2dcamera to the scene with default setting.

Now nothing is shown in game window.

tk2dcamera preview also shows nothing. But the camera preview shows the scene.

the game contents are clearly within the boundary of the camera.

when I closely examine the game window I can see something very small on the bottom left corner of  the screen. It looks like the content of the scene.

How do I fix this issue?


unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: tk2d camera empty screen
« Reply #1 on: October 20, 2013, 11:36:34 am »
What version of Unity and 2D Toolkit are you using?
There was a bug in versions of Unity prior to 4.2 where the camera preview was wrong (which is why we have our own preview window). The boundaries are wrong as well. AFAIK it was fixed in 4.2, but 2D Toolkit 2.x added a custom drawing code to work around the unity bug as well. Looks like you're on an old 2D Toolkit & unity.


Anyway, here are the tk2dCamera docs.
http://www.2dtoolkit.com/docs/latest/tutorial/tk2dcamera.html

The most important thing is that your sprite collection + tk2dCamera settings must match. If your tk2dCamera is set to 1 pixel per meter, then your sprite collection should be set up the same way. Otherwise, your sprites won't be the right size.