Hey there,
i have a small feature request. Often i need to set the Origin of the Sprite to its center,
like
sprite.setOrigin(sprite.getLocalBounds().width / 2.f,
(sprite.getLocalBounds().height / 2.f);
or as a function
void centerOrigin(sf::Sprite& sprite){
sf::FloatRect bounds{sprite.getLocalBounds()};
sprite.setOrigin(bounds.width /2.f, bounds.height /2.f);
}
it would be nice if the sf::Sprite class would provide a Method that sets the Origin to Center automatically, like:
sprite.centerOrigin();
I'm for that feature =) it would be nice to see in SFML.
Additionally if your sprite has uneven size, dividing by 2.f might create rasterization issues and as such people would again have to write their own free function or similar.
static_cast<unsigned>(float)
static_cast<unsigned>(float)
It's obviously not about how to do it... ::)