I am using SFML 1.6 and am trying to rotate a resized sprite about its center. Rotating about a sprite's center seems to work fine if the sprite is not resized, but when resized, SetCenter() does not seem to place the sprite's center at the proper place, and the sprite ends up rotating about some other point.
For example, the following code is in my main game loop, as a test:
sf::Sprite test( ImageCache::GetImage("simple_bit.png") );
float rotation = 0;
test.SetPosition( 300, 300 );
//test.Resize( 50, 50 );
test.SetCenter( test.GetSize() / 2.f );
test.SetRotation( rotation++ );
screen.Draw( test );
This will work fine, and the sprite will appear to rotate about its center. Yet if the call to Resize() is uncommented, the sprite will seem to rotate around a point that is slightly off its center. The greater the difference between the resized sprite and the original image, the greater the distance between the desired axis and the axis I get.
The only reason I could think this would happen is if SetCenter() sets the center of the sprite in relation to the size of the Image, not the sprite. Some tests I have done seem to indicate this. If this is actually the issue, then this needs to be made more clear in the forums and tutorials (unless I'm just blind).
Am I missing anything?