SFML community forums

Help => Graphics => Topic started by: lfnunley on March 27, 2013, 08:14:46 pm

Title: Is it possible to disable Sprite auto re-size?
Post by: lfnunley on March 27, 2013, 08:14:46 pm
Hello all! I am wondering if it is possible to disable the auto re-sizing of sprites upon window re-size? On a related note, would it be possible to a sprite to preserve its apparent size while using a graphics window? For instance, like how on Google maps even though you may zoom in, location markers maintain their size.

I am planning on doing a project similar to Google maps, but for one area and interactive, so that's the nature of my question. Thanks for your replies in advance!
Title: Re: Is it possible to disable Sprite auto re-size?
Post by: Laurent on March 27, 2013, 08:51:12 pm
Quote
Hello all! I am wondering if it is possible to disable the auto re-sizing of sprites upon window re-size?
It's not the sprite which is resized, it's the view which is not resized. What you want to do is to catch Resize events, and adjust the active view to the new size of the window.

Quote
On a related note, would it be possible to a sprite to preserve its apparent size while using a graphics window?
If you use a view which is managed as described above, the sprites drawn in it will always have the same size.
Title: Re: Is it possible to disable Sprite auto re-size?
Post by: lfnunley on March 27, 2013, 11:14:12 pm
Okay, thank you very much.