Question about aspect ratio

I've read all of the posts and blogs about scaling your game to be pixel perfect to displays, but im not very interested in that. Right now Im running my game at a size of 640, 360 which scales evenly to all 16 by 9 displays. however I have the thing where game maker turns black bars on, to stop my sprites and such from getting distorted, but when I run the game at a resolution of like 1366, 768. It still looks distorted. Can someone explain to me why this is?
 

TsukaYuriko

☄️
Forum Staff
Moderator
Black bars on how many sides? Black bars on two sides cause the aspect ratio to be maintained rather than stretching the image separately on both axes, black bars on four sides will also ensure that the image is scaled by an integer factor. Only the latter kind would work around the issue you're describing.
 
Black bars on how many sides? Black bars on two sides cause the aspect ratio to be maintained rather than stretching the image separately on both axes, black bars on four sides will also ensure that the image is scaled by an integer factor. Only the latter kind would work around the issue you're describing.
How do I get black bars on all sides?
 

TsukaYuriko

☄️
Forum Staff
Moderator
By implementing it manually, as I don't think there's a setting for it.

Set your game to ignore the aspect ratio (Game Options -> target platform -> Graphics -> Scaling -> Full scale).
Calculate the biggest direct multiple of the native resolution that the target monitor can display. Multiply both the width and the height by integer factors incrementing by one. The first time either dimension exceeds the monitor resolution's bounds, the previously iterated resolution is your target resolution / scale factor.
Either fullscreen or borderless window your game.
Disable automatic drawing of the application surface.
Set the game's native resolution to the target monitor's resolution.
Draw a black rectangle across the entirety of the game window.
Draw the application surface, at the new target resolution / scaled by the scale factor, centered.
 
Top