Hello. I'm using SFML 1.6 and I am having problems trying to rotate a sprite because the axis of rotation is located in the upper left corner. How could I rotate the sprite with an axis of rotation located at the center of the sprite without changing permanently the center of the sprite? All the logic of my code is based on the sprite's center located in the upper left corner and I wondered if there was any alternative to perform this rotation without using SetCenter () at the beginning of the code, perhaps with some maths and sprite->Move (). I tried the following:
sprite->SetCenter(sprite-> GetSize (). x / 2.0f, sprite-> GetSize ().y / 2.0f);
sprite->Rotate (angle);
sprite->SetCenter (0, 0);
It does not work because the sprite moves when I move the center, resulting in the sprite rotates around its upper left corner.