Hello Guest

Author Topic: About Sprite Mesh Size  (Read 4055 times)

lixu

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 2
    • View Profile
About Sprite Mesh Size
« on: May 05, 2013, 04:59:20 am »
I noticed the quad mesh used by 2D Toolkit Sprite is not 1:1 in width/height. Why not use a square directly? I think if we use square, we can set sprite's scale according the image size in pixel accurately.
So the second question is, how to replace the default sprite mesh to a square one?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: About Sprite Mesh Size
« Reply #1 on: May 05, 2013, 12:12:55 pm »
1:1 in what way?

The quad mesh used by 2D Toolkit is built to fit the part of the sprite image that is visible. If your sprite is 32x84, the sprite will form that ratio. The physical size depends on how you set up the ortho size / wether you use tk2dCamera / etc. When you set up the sprite size in the sprite collection settings, it will appear pixel perfect at that resolution automatically without any scaling required, as long as you display it with the same camera parameters. Eg. if you build your sprite collection with "Use tk2dCamera", then display it with a tk2dCamera for it to be automatically pixel perfect.

lixu

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: About Sprite Mesh Size
« Reply #2 on: May 06, 2013, 05:14:14 pm »
Thanks, as you suggestion, I checked "use tk2dCamera" in SpriteCollection settings,  and it works fine.