Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - pfox

Pages: [1]
1
General / rotating a sprite on the center of the image
« on: June 25, 2009, 07:43:35 pm »
Thank you very much for the quick reply.. I managed to get it working (stupid n00b mistake on my part).

It's a great library. Thanks again!

2
General / rotating a sprite on the center of the image
« on: June 25, 2009, 07:33:55 pm »
hi.. i have a sf::Sprite that i'm trying to rotate, but whenever it rotates, it rotates it based off of where the center of the sprite is via SetCenter(). But this also affects where the origin of the sf::Image for the sprite is rendered.. This seems like it would be a pretty common issue, and I'm curious if anyone has a solution/recipe for this?

Basically, if I have a sprite with a circle/wheel image for it, I want that wheel to "spin" in place and not actually "fly around in circles" based off of the origin of the image, relative to it's sprite (as seems to be the default case)

I imagine the solution involves changing the center of the sprite every time you SetRotation(), I just don't know the math involved. Is there a better way? Am I thinking about this problem the wrong way?

Any help would be greatly appreciated, thanks.

Pages: [1]
anything