[SOLVED] "Keep Aspect Ratio" GGS and Disabled Application Surface

Samuel Venable

Time Killer
It appears the Global Game Setting for the game to keep its aspect ratio is ignored when the application_surface is disabled. So it stretches either way. But I need the application_surface disabled to help Android performance.

According to the FAQ
Are you stopping support for Studio 1.X?

Support for GameMaker: Studio 1.4 will continue for the moment, and it will receive maintenance to ensure you can still make and submit games for the various export platforms. However it will not be receiving new functionality or minor bug fixes and we have stopped taking user feedback suggestions.
http://help.yoyogames.com/hc/en-us/articles/230330328-GameMaker-Studio-2-FAQ

...apparently this won't get fixed. So I was wondering if there were any work-arounds. I've tried using a second view port and that made it lag like crazy on Android. Nearly everything I do in GM: Studio causes Android lag.

Thanks
 

RangerX

Member
Without application surface, you need to resize the port on screen.
OR
A nice work around, have your game start with the app surface, do the needed scaling, turn off the app surface. This should work because the port will take whatever the size the app surface had when you turn it off. (I think)
 

Samuel Venable

Time Killer
Create your aspect ratio variable and multiply your sizes with it;

Code:
aspect_ratio = widht/height;
@JaimitoEs I did as you suggested in the Room Creation code of every room with the following code:
Code:
ww = window_get_width();
wh = window_get_height();
aspect_ratio = ww / wh;
view_wport[0] *= aspect_ratio;
view_hport[0] *= aspect_ratio;
And it WORKS! Thank you so much guys!
 
@JaimitoEs I did as you suggested in the Room Creation code of every room with the following code:
Code:
ww = window_get_width();
wh = window_get_height();
aspect_ratio = ww / wh;
view_wport[0] *= aspect_ratio;
view_hport[0] *= aspect_ratio;
And it WORKS! Thank you so much guys!
I am also facing the same situation where i want to keep app surf disabled and want the game to run at correct aspect ration but i don't understand how to make that work. Please can you help me or post an example here? How to make black bars appear on devices in order to correct aspect ratio?
 

RangerX

Member
If you want simple letterboxing and to keep aspect ratio, you don't have to do nothing.
In the graphic tab of your target's global settings you simply check "keep aspect ratio" box and GMS will do it for you.
 

Mehdi

Member
@RangerX
your solution isn't helpful because we HAVE to disable the Application Surface as it lowers fps drastically on mid-low android devices. And when you disable Application Surface the aspect ratio adjustment in Global Game Setting is deactivated.
 
Top