Hello Guest

Author Topic: Set sprite size in pixels  (Read 3347 times)

ilyahan

  • Newbie
  • *
  • Posts: 1
    • View Profile
Set sprite size in pixels
« on: July 09, 2013, 01:13:01 pm »
I have a sprite which size is 14x14 px. How can I set size of this sprite in pixels?(I use tk2dCamera)
My code:
Code: [Select]
scale.x=newSize.x/14f;
scale.y=newSize.y/14f;
But it doesn't work :(

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Set sprite size in pixels
« Reply #1 on: July 09, 2013, 01:41:04 pm »
If you use the tk2dCamera, and your sprite is set to "Use tk2dCamera", the sprite will already be pixel perfect. If its pixel perfect to start with, your code should work.