I have this sprite I want to rotate, but when I call
SetRotation() on it, it behaves weird, like the hinge is on the top left corner. I'm aware that I can use
SetCenter() to place the hinge in the center of the sprite, but I like positioning elements using the top left corner. I wrote a wrapper class for
sf::Sprite and wrote the
setRotation() method like this:
void CSprite::setRotation(float degrees)
{
float oldXCenter = drawable.GetCenter().x;
float oldYCenter = drawable.GetCenter().y;
drawable.SetRotation(degrees);
drawable.SetPosition(oldXCenter, oldYCenter);
}
But it still doesn't do what I want... Does anyone have a solution?