Hello Guest

Author Topic: tk2dcamera scale  (Read 5950 times)

robs

  • Newbie
  • *
  • Posts: 3
    • View Profile
tk2dcamera scale
« on: March 11, 2013, 03:57:08 am »
Hey all, I'm a new user to 2d toolkit and I'm using it for a side scroller. I've got the tk2dcamera up and running and I've set the flag "use tk2dcamera" in my tile collection. The first thing I've noticed after doing that is that navigating around the scene in the editor takes much longer than it should. It seems like, although my sprites are 128x128 and set to 1 to 1, they are huge in the editor. Do I have everything set up correctly, and if so, is this behavior normal?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: tk2dcamera scale
« Reply #1 on: March 11, 2013, 09:40:02 am »
Yup.
With tk2dCamera, one pixel = one world unit. So yeah your world is going to be fairly big.
You could just use a normal ortho camera - the system is fully compatible with that too (except you will have to handle rescaling for different resolutions yourself).

robs

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: tk2dcamera scale
« Reply #2 on: March 11, 2013, 04:40:48 pm »
Thanks for replying so quickly! Is there a way to modify the speed that the editor camera moves? Also, I noticed that my in game camera is fairly close to the sprites, making the world feel zoomed in. Is there a way to pull the camera back?

Thank you for your help.

dotty

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 65
    • View Profile
Re: tk2dcamera scale
« Reply #3 on: March 11, 2013, 05:15:23 pm »
the camera can be moved like a normal gameObject. I think it's default Z is -10, so move your sprites back so that they're not so close. As for the editor camera, why not zoom out? I use tk2dCamera all the time, and the editor is pretty much useless. You might as well switch to the "game view" then using the properties panel to move stuff around. At least that way you'll get a decent idea about whats going on.

robs

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: tk2dcamera scale
« Reply #4 on: March 11, 2013, 05:28:47 pm »
I meant the camera that you can fly around the scene view, not the editor camera when you run the game. Is that what you're referring to?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: tk2dcamera scale
« Reply #5 on: March 11, 2013, 05:29:50 pm »
Thanks for replying so quickly! Is there a way to modify the speed that the editor camera moves? Also, I noticed that my in game camera is fairly close to the sprites, making the world feel zoomed in. Is there a way to pull the camera back?

Thank you for your help.

I don't know how big your world is, but if it is really big that moving around is an issue, then perhaps using a normal ortho camera might be better - just to make it more manageable.

p.s. There will be a tk2dOrthoCamera in a future release which will handle auto-rescaling like the tk2dCamera does, so if you're relying on tk2dCamera doing all the scaling for you, this could be a viable option.

dotty

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 65
    • View Profile
Re: tk2dcamera scale
« Reply #6 on: March 12, 2013, 09:35:37 pm »
What will be the differences between tk2dOrthoCamera and tk2dCamera?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: tk2dcamera scale
« Reply #7 on: March 12, 2013, 09:45:58 pm »
tk2dCamera = world sized units, origin from bottom left.
tk2dOrthoCamera = all the rescaling options from tk2dCamera, in a normal orthographic camera. You set it up in any way you like, whatever orthographic size, etc. You decide the unit size.