Oh thanks. Well I can't do that move because I need to keep the global position relative to other sprites I display.
I've done this and it works
transf.rotate(mIt->fDegrees,mIt->spMissile.getPosition().x + mIt->halfWidth, mIt->spMissile.getPosition().y + mIt->halfHeight);
_window.draw(mIt->spMissile, transf);
But I don't know why I have to pass the global center position of the sprite to rotate it, but im glad it works !
Well, I needed to :
- calculate and save half width / height (2 int) for each item.
- save degrees in each items for post-using, instead of using it directly
- declare and define a new local variable sf::transform
- pass it as argument and add global sprite position
all that to do a simple rotation. I still think it would be simpler to add to sf::Transformable a SetRotationOrigin() member (by default rotation origin would be 0,0), but its ok