Jump to content


Photo

Different Android Screen Resolutions?


  • Please log in to reply
1 reply to this topic

#1 JeZ-l-Lee

JeZ-l-Lee

    GMC Member

  • GMC Member
  • 291 posts
  • Version:GM:Studio

Posted 29 March 2016 - 01:36 AM

Hi,

 

We are trying to make a game with GameMaker:Studio with Android devices being our primary target.

We are having great trouble in creating a display system that will look good on all the different Android screen resolutions.

Any help with above would be appreciated, thanks!

 

We currently just scale(aspect ratio ignored) the display and it looks pretty bad on some devices.

Would it be possible to get the devices screen width and height in pixels BEFORE creating the room?

Thanks again for your help...


  • 0

JeZxLee
16BitSoft Inc.
Video Game Design Studio
www.16BitSoft.com

GM-Forum-Signature1.gif


#2 randomdude90

randomdude90

    GMC Member

  • GMC Member
  • 111 posts
  • Version:GM:Studio

Posted 29 March 2016 - 02:40 AM

I find that 1280x720 seems to work really well for making multiple supported screensizes without code. However, I am developing a responsive app maker extension (Using Gamemaker Studio), which gets the correct scale and units that google recommends using for app design. This is what I use to create a foundation for a scale.

///get_px(pixels)
/*
** Takes the Density-independent Pixels (dp) value and converts it to screen pixels
** Input: integer : Density-independent Pixels
** Output: integer : Screen Pixels
**
** This will allow you to make sure everything is drawn the same across different Android Devices
*/
var dp = argument0;
return dp * (display_get_dpi_x() / 160);

160 is the default value, there are 5 different values that could be.

 

Then I just call to it whenever I need a value converted, like instead of

draw_text(16,16,"Hello mate")

I use

draw_text(get_px(16),get_px(16),"Hello mate")

which scales it rather nicely (With some tweaks here and there). You can also try using the following functions:

display_get_dpi_x
display_get_dpi_y
display_get_gui_height
display_get_gui_width
display_get_height
display_get_width

  • 0

Visit my website and view all of my projects at: https://www.chrisburgess.us

or find me on the Gamemaker Marketplace at:https://marketplace....9/chris-burgess