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

Author Topic: Change Rotation Point?  (Read 1734 times)

0 Members and 1 Guest are viewing this topic.

addel

  • Newbie
  • *
  • Posts: 17
    • View Profile
Change Rotation Point?
« on: June 28, 2013, 07:37:20 pm »
I am trying to rotate a sf::Sprite however it rotates using the top left point of the sprite however i need to rotate using the center point.

How can i change the rotation point of a sprite?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11033
    • View Profile
    • development blog
    • Email
Re: Change Rotation Point?
« Reply #1 on: June 28, 2013, 07:42:08 pm »
By reading the tutorial and/or the documentation. :P

You can also use sprite.rotate() or sprite.setRotation().
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Change Rotation Point?
« Reply #2 on: June 28, 2013, 07:56:02 pm »
You can also use sprite.rotate() or sprite.setRotationOrigin().
:-X
Back to C++ gamedev with SFML in May 2023

addel

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: Change Rotation Point?
« Reply #3 on: June 28, 2013, 07:58:54 pm »
Thanks FRex :D

 

anything