Page 1 of 1

[RPG/JS] Screen dimensions

Posted: Wed May 24, 2017 1:52 am
by mwilliams
Is it possible to get the device screen dimensions from within a script? Maybe using the q_getSystemValue function?

Re: [RPG/JS] Screen dimensions

Posted: Wed May 24, 2017 11:27 am
by tsupartono
Below is an example of getting the screen width & height (in the current device orientation), and outputs the result to the console.

Code: Select all

lrexec(
    function()
    {
        this.q_getSystemValue("DEVICE-SCREEN-SIZE-WIDTH");
    },    
    function(value)
    {
        this.console("screen-width = " + value);
        this.q_getSystemValue("DEVICE-SCREEN-SIZE-HEIGHT");
    },
    function(value)
    {
        this.console("screen-height = " + value);
    },
}