GMLscripts.com

Discuss and collaborate on GML scripts
Invert

You are not logged in.

#1 Re: Script Submission » Get the diagonal screen size in inches » 2020-09-01 05:53:55

Thanks again. Even from this brief conversation I learnt something new!
I would like to attempt to write a more advanced variation for multiple screens, but I only have one screen and I will not be able to test it...

#2 Re: Script Submission » Get the diagonal screen size in inches » 2020-09-01 03:23:54

Thank you for your feedback. Does it make sense to detect multiple monitors if the device is mobile?

#3 Script Submission » Get the diagonal screen size in inches » 2020-08-30 17:37:57

gkri
Replies: 4

This simple script returns the diagonal screen size of the device the game is running on, in inches. I wrote and use it as an easy way to detect if the mobile device the game is running on is a tablet.

Expand/// get_diagonal_screen_size()
//
//	Returns the diagonal screen size in inches
//
/// GMLscripts.com/license
function get_diagonal_screen_size(){

return sqrt(sqr(display_get_width()) + sqr(display_get_height())) / display_get_dpi_x();
}

Board footer

Powered by FluxBB