My phone is using a resolution of 360 x 640 with a 9:16 aspect ratio. I set my room in game maker to 360 x 640 and game maker thinks it's in landscape mode. I disabled landscape mode in the android settings and set to portrait only, like it should be. How do I get it to scale properly?

This is the code I have in my Scale Manager Object.

Create Event:

///Display Properties
ideal_width = 0;
ideal_height = 640;

aspect_ratio = display_get_width()/display_get_height();
ideal_width = round(ideal_height/aspect_ratio);

//check for odd numbers
if(ideal_width & 1) {

for (var i = 1; i <= room_last; i++) {
    if(room_exists(i)) {

surface_resize(application_surface,ideal_width , ideal_height);

enter image description here


I switched the variables locations in this line

ideal_width = round(ideal_height/aspect_ratio);

Now it's

ideal_height = round(ideal_width/aspect_ratio);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.