Android Scaling

L

lord_berto

Guest
Is there anyway to display the game at its native resolution without stretching on phone?
( game maker automatically stretches/scales your game to take up the screen )
Similarly to how Gui layers work?

My games resolution is 288x512.

my phone is 720x1280.

this leaves a lot of emptiness that can be used for ad's or perhaps other things.
 
L

lord_berto

Guest
GameMaker offers you 2 choices. "Full Scale" and "Keep Aspect Ratio" if you look under the graphic tab of your target's global settings.
"Keep Aspect Ratio" will prevent any stretching to happen.

If you need to both never stretch + pixel perfect at all time, this needs some coding. I invite you to my tutorial (and the tutorials I am also linking) here if that's what you need:
https://forum.yoyogames.com/index.php?threads/how-to-properly-scale-your-game.995/
I tried your first method which is what i am looking for, but so far my game just shows a black screen. hmmmm.

I tried your first method which is what i am looking for, but so far my game just shows a black screen. hmmmm.
Ok i got it to display now, but the X,Y pos of the surface is not in the center. seems to be more towards the bottom left corner?

UPDATE: okay so it displays well and perfectly in the center on windows but on my andriod it gets cut off sort of like this :

Untitled.png the big square is my andriod screen, and the little one is the surface.

Untitled.png the big square is my andriod screen, and the little one is the surface.
Update: okay for some reason on andriod the code doesnt seem to work at all, and its because Display_get_height/width funtion doesnt seem to work right. If i do ( if display_get_height()>10 { Game_end() }} <--- it doesnt do anything


Mod Edit: Quadruple post merged. Please use the EDIT button in future
 

Attachments

Last edited by a moderator:
Top