Why even change anchor points?

Hello,
I was wondering about what the actual purpose is of changing anchor points. I know you then rotate objects around its anchor point and speed up the positioning part but about the positioning part, you just have to add the half of the current objects size if the anchor point was at its default, right at the center. Therefore, it does not really save you that much time and if you only change the anchor point for rotation purposes, it can cause problems with the positioning of the object. So why don’t just let the anchor stay at the center? Why would you change it? It would be nice if you could share your thought s on this, even though that it maybe is overthinking. Thanks!

There are a lot of uses. If you want to position a sprite at the top right of the screen, set its anchor point to 1,1 and use the screen width/height to position it. That’s device independent.

I’ve written games where I want to rotate a single sprite around different rotation points depending on the situation. It’s easier recalculate position based on the new anchor point than it is to write code to rotate a sprite around an arbitrary point (cocos2d also probably does that faster than any code I could quickly whip up).

I would also guess that other transforms (like scaling) are based on the anchor point, so how a sprite scales up/down will be based off the position of that anchor point.

There are lots of valid reasons to change anchor point! It all depends on what is easiest for the situation at hand.

1 Like

Hmm i see. But if there are these many advantages, why has the developers of box2d made the option to change the anchor point unavailable?
Thanks again bud :slight_smile: