That really made things SIMPLE as SFML is supposed to be and I think that made the Sprite class so freaking sexy.
void flipX(sf::Sprite & s )
{
auto rect= s.getTextureRect() ;
rect.left += rect.width ;
rect.width = -rect.width ;
s.setTextureRect(rect) ;
}
void flipY(sf::Sprite& s)
{
auto rect = s.getTextureRect() ;
rect.top += rect.height ;
rect.height = -rect.height ;
s.setTextureRect(rect) ;
}
There. It's all sexy again.
You can flip a sprite if you give them a negative scale...
sf::Sprite RandomSprite;
RandomSprite.setOrgin(RandomSprite.getGlobalBounds().width/2,RandomSprite.getGlobalBounds().height/2)//So the orgin(aka center) is in the center.
RandomSprite.Scale(-1,-1);//Flips and Backward
RandomSprite.Scale(-1,1);//Backwards
RandomSprite.Scale(1,-1)//Flips
Your welcome... Maybe should be said somewhere in docs that you can get away with this.