Author Topic: Why I use "Make Pixel-Perfect" and the gameobject's transform's P:x=0.5,y=-0.5?  (Read 3541 times)

noob22

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 38
    • View Profile
Why they change position?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
If your sprite doesn't have even dimensions  (such as 20x30), and instead has even dimensions such as (21x33), dividing that by 2 in order to center it results in a floating point value. such as 10.5 x 16.5. That's why you see "0.5" there. It just ensures that the pixels look crisp.

noob22

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 38
    • View Profile
If your sprite doesn't have even dimensions  (such as 20x30), and instead has even dimensions such as (21x33), dividing that by 2 in order to center it results in a floating point value. such as 10.5 x 16.5. That's why you see "0.5" there. It just ensures that the pixels look crisp.
Thanks for your reply!
You are so kind!I'm a beginner!Thanks!