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

Author Topic: TransformToLocal() in SFML 2  (Read 1467 times)

0 Members and 1 Guest are viewing this topic.

Ruckamongus

  • Jr. Member
  • **
  • Posts: 70
    • View Profile
TransformToLocal() in SFML 2
« on: September 18, 2012, 01:46:21 am »
Is there an equivalent to sf::Drawable::TransformToLocal(const sf::Vector2f&) in SFML 2? If not, what exactly does it do? It seem simple enough by the name. Is it correct to assume that it takes the global coordinates supplied and returns the coordinates relative to the origin of the given sprite? I'm porting something over from SFML 1.6 (which I've never used). Thanks!


Edit: I figured it out, it's fairly simple: Sprite.getInverseTransform().transformPoint(sf::Vector2f(x, y))
« Last Edit: September 18, 2012, 03:47:57 am by Ruckamongus »

 

anything