rorypicko Posted May 30, 2014 Share Posted May 30, 2014 What is the difference between pivot and anchor? Anchor is set to percentages of width, and pivot is set to exact pixel values, but is that the only difference? If i have a sprite that it 100x100 and i do either of the following code sprite.anchor.set(0.5, 0.5); or sprite.pivot.set(50,50); it appears to do exactly the same thing? Including when i rotate the sprite, which appears to be the difference in the description. and also, setting both of these seems to have weird results not sure which is being favoured. Quote Link to comment Share on other sites More sharing options...
d13 Posted May 30, 2014 Share Posted May 30, 2014 Pivot is currently "broken": https://github.com/GoodBoyDigital/pixi.js/pull/730 You're right, at the moment it just works like `anchor`, except with weird effects if the sprite is a different width and height than its texture.Hopefully it will be "fixed" because it would be extremely useful to be able to rotate a sprite while still maintaining its x/y anchor at the top left corner. rorypicko 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.