SFML community forums
Help => Graphics => Topic started by: Mr. House on October 12, 2011, 03:16:21 am
-
Hello,
I have a sprite that I would like to rotate around a point that is not the origin nor a point of the shape.
Here is a screenshot of my situation:
http://i.minus.com/ibt8ncX55ODhrh.png
I want that yellow sprite to rotate around the centerpoint of that circle like the Moon around the earth, so that the sprite follows the shape of the sectors.
I've tried messing around with the Sprite.SetCenter() methods but I'm not sure if what I'm doing is right.
Anyone have any wisdom on this matter? I'll post my code if needed. I'm using 1.6.
-
yeah SetCenter() does what you need, you're just going to have to do some maths to work out exactly what parameters to pass to make it work how you want :)
-
It doesn't seem to though. I used SetCenter(50,50) but it doesn't place it at point (50,50). I don't get it :/
Would you like me to post my code and see if you can offer me a solution?
-
yeah that would be helpful. also upload the image you are rotating as well as its dimensions
-
Nevermind, I figured it out.
-
You wouldn't mind posting how you solved it?
I'm having similar problems ;/
-
What's the problem you're having? We might be able to help.