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

Author Topic: Getting Position of a Sprite after it rotated?  (Read 1873 times)

0 Members and 2 Guests are viewing this topic.

Austech

  • Newbie
  • *
  • Posts: 23
    • View Profile
Getting Position of a Sprite after it rotated?
« on: December 06, 2009, 08:41:50 am »
Sorry for all the questions, but Is there a way to get the position of a sprite after it rotated? Because when I try it gets it's original position, not the area that it rotated to.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Getting Position of a Sprite after it rotated?
« Reply #1 on: December 06, 2009, 11:08:59 am »
Use this:
Code: [Select]
sf::Vector2f position = sprite.TransformToGlobal(localPoint);

Where local point is the point on the sprite that you want top get the coordinates in global space (example: (0, 0) for its current center).
Laurent Gomila - SFML developer