Legacy GM Some help with scaling/sprite stretching



Hi again everyone!

I was wondering if anyone had any advice for how to 'scale' up a game's display (i.e make its port on a window/desktop bigger than the room itself) without the sprites stretching.

I've tried doing it using views, using the window_set_size() function, and a couple of others, however my sprites always seems to get stretched, and lose their clarity. I should stress that I'm using power of 2 sprites (they're 64x64), so to my brain they should scale quite nicely.

I'd like to avoid simply scaling everything up in the 'sprites' and such, because I'm trying to keep the game authentically low-resolution.

Any help is greatly appreciated!


Making a sprite power of 2 doesn't make it scale any different from a sprite that isn't. Power of 2 mostly only comes into play when you put sprites on their own texture pages for use in 3D.

In order to keep the pixel size 1 to 1 regardless of the screen resolution, you would need to get the size of the game window, and then set the camera view and port's size to match it. You will also need to set up view 0 for use in each room.

So something like this:
//Room creation code
var camera = view_camera[0];
var window_width = window_get_width();
var window_height = window_get_height();

view_set_wport(0, window_width);
view_set_hport(0, window_height);
camera_set_view_size(camera, window_width, window_height);
Another thing you could do is pick a resolution that neatly scales up to the most common screen resolutions (like 1080p and 720p) pixel perfectly.
Good candidates are: