I'm porting one of my old projects to sfml 2.0, and I had a background that I scaled using
sprite.setSize(windowWidth, windowHeight)
Now, it seems like setSize
has ben removed in 2.0, and I'm wondering what the intended replacement is.
I know there is a setScale
function, and that I could do something like:
auto size = sprite.getTexture()->getSize();
sprite.setScale(float(windowWidth)/size.x, float(windowHeight)/size.y);
but I think this is really ugly and clunky, is there another way to do it?
scale(newSize/oldSize)
internally? If you have something that works use it. – House Jun 13 '13 at 05:21