Jump to content

What's the difference between pivot and anchor for a Sprite?


Bilge
 Share

Recommended Posts

anchor uses a normalised value (0 = left edge, 1 = right edge)

pivot is measured in pixels / points.

So to target horizontal middle using anchor use the following

sprite.anchor.x = 0.5;

 

To do the same via pivot do the following:

sprite.pivot.x = 0.5 * sprite.width;

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...