Help => Graphics => Topic started by: rcplusplus on June 18, 2012, 03:38:52 am
Title: Best way to display sprites
Post by: rcplusplus on June 18, 2012, 03:38:52 am
I have a window on which I'm going to display a ton of sprites for a game. I'm using SFML 2.0 which adds a view to windows automatically, which is good I hear because it converts measurements and locations for the window so it behaves the same, regardless of size. Problem is, when I resize the window, it stretches/shrinks all the sprites. Is there a way to resize the window but NOT the view? And what is the best way to set up views/windows to adjust to ALL resolutions? Because I want the game to look more or less the same on ALL screen sizes... thanks.
Title: Re: Best way to display sprites
Post by: Laurent on June 18, 2012, 08:28:14 am
Quote
Is there a way to resize the window but NOT the view?
In fact you want to resize the view so that it has the same size as the window (the default behaviour is to keep the initial size -- that's why things are stretched).
You just have to catch the Resized event and reset the view with the new window size.
Title: Re: Best way to display sprites
Post by: eXpl0it3r on June 18, 2012, 11:56:15 am