# Sprite not rotating around its centre after Scaling at its centre

If I scale a sprite at its centre, then try to rotate it around its centre as well, the rotation does not occur around its centre.

If you need to rotate, for example a scaled ball,the way its working it is set the scale center at the top left (0,0) set the scale that you want, and then set the rotation center to the middle of the scaled sprite, and then apply the rotation modifier.

blaBloBliSprite.setScaleCenter(0, 0);
blaBloBliSprite.setScale(0.667f);
blaBloBliSprite.setPosition(557, CAMERA_HEIGHT / 2 - blaBloBliSprite.getHeightScaled() / 2);
blaBloBliSprite.setRotationCenter(blaBloBliSprite.getWidthScaled() / 2, blaBloBliSprite.getHeightScaled() / 2);


But I want to scale a sprite at its centre as well.

Is there any way of doing it?

• What technology are you using? How is rotation and scale stored and computed? This question is not very helpful, all I can read is "THIS NO WORK, NEED HELP" It can be done in a million ways... – rioki Apr 23 '13 at 14:43
• I don't think any new thing you have to do for this. Default rotation center is middle of any sprite. So you don't have to set it manually. If you found any thing wrong again then you have to become more precise about you question so we can understand more better. – Siddharth Apr 23 '13 at 17:18

float centerX = sprite.getX() + sprite.getWidth() / 2;