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

Author Topic: Hello ... Need Help here in rotation :(  (Read 1290 times)

0 Members and 1 Guest are viewing this topic.

shadowguns

  • Newbie
  • *
  • Posts: 8
    • View Profile
Hello ... Need Help here in rotation :(
« 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
« Last Edit: May 18, 2012, 11:21:26 am by shadowguns »

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Hello ... Need Help here in rotation :(
« Reply #1 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).
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

shadowguns

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Hello ... Need Help here in rotation :(
« Reply #2 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 ?