stagewidth stageheight mobilescale

  • Hi, trying to figure out what stagewidth and stageheight returns depending on mobilescale.
    If mobilescale is not set (so 0.5 by default) then stagewidth & stageheight returns half the real screen width and height and stagescale is 0.5 (tested on my S7 I have stagewidth= 720 instead of the 1440 real resolution).
    If mobilescale is set to 1 (default setting since ?) then stagewidth & stageheight returns quater the real screen width and height and stagescale is 1 (tested on my S7 I have stagewidth= 360 instead of the 1440 real resolution).

    Can someone explains me why ?

    You can test on your mobile device :
    with no mobilescale setting
    with mobilescale:1

  • Hi Jerome!

    I made a quick test on my Redmi Note 4 and a standard Krpano tour returns stagewidth == 640. Then I remembered about pixelratio readonly variable (see here https://krpano.com/docu/actions/#device.pixelratio). Pixelratio of my phone is 3 and 3 * 640 == 1920 which is the real resolution of my phone.

    For your device it seems that pixelratio is 4 (360 * 4 == 1440).

    THX !
    so to know the real resolution we just need to do realdevicewidth="calc(device.pixelration * stagescale * stagewidth)" !

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!