SFML community forums

Help => General => Topic started by: shadowguns on May 18, 2012, 11:13:43 am

Title: Hello ... Need Help here in rotation :(
Post by: shadowguns on May 18, 2012, 11:13:43 am
Hello Every One ..
i want to ask ... how can i rotate my sprite to a certain theta (angel) ?
for example ..
if the sprite is at angel 0
and the certain angel is 60
i want the sprite to rotate untill it reaches 60 degree
how can i make that !? ... please help ! Thanks a lot
note : i'm using SFML 2.0
Title: Re: Hello ... Need Help here in rotation :(
Post by: Nexus on May 18, 2012, 11:37:38 am
Look at the documentation, there is a rotate() method.

For a continuous rotation, just rotate the sprite every frame a little bit (either in a constant frame rate, or multiply the angle with the frame time).
Title: Re: Hello ... Need Help here in rotation :(
Post by: shadowguns on May 18, 2012, 11:45:10 am
thanks for replying :)
i know rotate() method !
but here how i use it ..
sprite.rotate(0.5);
where 0.5 is the ratio of increasing in angel !
is that it ?
if so ... how can it stop untill it reachs my angle ?