Hello Guest

Author Topic: Sprite positioning is scaling  (Read 4088 times)

Aaron

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 16
    • View Profile
Sprite positioning is scaling
« on: March 13, 2014, 08:43:00 am »
Hi. I've been away from 2DTK for a while and started up again, downloading version 2.4 Beta 3. I made a scene, added a tk2dCamera, set Native and Preview res to 640x1136, added a Sprite collection and added a sprite. However when I set the position to 1, it jumps what looks to be 100 pixels. I guess this has something to do with the 100ppm setting but I thought all that was handled automatically.

Is there anything else I should check or do I have to mess with the camera Zoom Factor?

Thanks
Aaron

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Sprite positioning is scaling
« Reply #1 on: March 13, 2014, 12:01:02 pm »
If its 100 pixels per meter, then 0.01 increment = 1 pixel. If you want it to behave like 100 units = 100 pixels, then you should set it to 1 pixel per meter in the sprite collection & camera.

Aaron

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: Sprite positioning is scaling
« Reply #2 on: March 13, 2014, 08:03:17 pm »
Thanks, so it's as I was suspecting. Has it always been this way or am I just not remembering it as I thought that originally it was running 1:1.

The 100 seems to be the default because according to the 2dToolKit docs, it works better with Unity. If I change it to 1 is this going to be a problem, or should I use Zoom Factor to solve the issue. If I set ZF to 0.01 then from my admittedly simple tests, the positioning seems to work well.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Sprite positioning is scaling
« Reply #3 on: March 13, 2014, 10:28:50 pm »
We changed the default to 100, as Unity 2d defaults to the same number as well, and the number works well with 2d physics in unity 4.3. If you want to use 2d physics in unity, just stick with 100 and adjust to using 0.01 as pixel units. If you don't care about that, set it to 1 and that'll work fine too.