• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Windows Need help with desktop scaling

T

ThatGuyMiniB

Guest
I have been trying to figure out scaling for desktop and I can't seem to figure it out. I always seem to get black bars. I have looked at pixelated popes videos but again can't figure it out. I am using gamemaker 2

Code:
if(os_type == os_windows){

ideal_width = 1920;
ideal_height = 0;

start_b_width = display_get_width();
start_b_height = display_get_height();

aspect_ratio = display_get_width()/display_get_height();

ideal_height = round(ideal_width / aspect_ratio);

if(ideal_height & 1){
    ideal_height++;
}

room_set_width(room0, ideal_width);
room_set_height(room0, ideal_height);
room_goto_next();
surface_resize(application_surface, ideal_width, ideal_height);

}[/SPOILER]
Code:
if(display_get_width() != start_b_width || display_get_height() != start_b_height){

aspect_ratio = display_get_width()/ display_get_height();

ideal_height = round(ideal_width / aspect_ratio);

if(ideal_height & 1){
    ideal_height++;
}

room_set_width(room0, ideal_width);
room_set_height(room0, ideal_height);
room_goto_next();
surface_resize(application_surface, ideal_width, ideal_height);
start_b_width = display_get_width();
start_b_height = display_get_height();
}

[/IMG]
[/IMG]



 
If you watched my videos you should know that making a game with an ideal width over 960 is a REALLY bad idea. Nor should you be checking the resolution ever single step and adjusting based on it.

Room set width and height also doesn't really do anything for you as far as your resolution is concerned.

I suggest you re-watch my videos, because you seemed to have missed a great deal of the information in there.
 
Top