Stageheight and stagewidth depended stagescale without onresize event?

  • Hi all,

    Is it possible to check the stagewidth and stageheight without using the onresize event?

    This is the code I use.

    <action name="checkReso">
    if(device.html5,
    if(stagewidth GT 770,
    if(stageheight GT 790, set(stagescale,1.2));
    );
    );

    if(device.html5,
    if(stageheight LT 750, set(stagescale,0.7));
    );
    </action>

    <events onresize="checkReso();" />

    It's now only working when you change orientation. But I need it right from the start.

    Does someone know if this is possible?

  • Hi,

    you can start your action in any way you want. You could put it into the global or scene onstart-event, into the onsceneloaded-event, into any plugins or hotspots onloaded-event etc. If you choose to use the global onstart-event the action starts once every time you start the tour.

    LG
    Nupsi

  • Hi,

    getting the stagewidth, stagegheight values and setting the stagescale setting is possible anytime.

    But note - when changing the stagescale setting, the stagewidth and stageheight will get changed and an new onresize event will happen.

    Best regards,
    Klaus

  • Hi,

    getting the stagewidth, stagegheight values and setting the stagescale setting is possible anytime.

    But note - when changing the stagescale setting, the stagewidth and stageheight will get changed and an new onresize event will happen.

    Best regards,
    Klaus

    Hi Klaus,

    Thanks for support. But when I load the tour on a iPad, the stagescale is not changed at first. I need to change orientation before the first if-statement will be executed correctly.


    Btw, great that HTML5 multiresolution is comming!

Jetzt mitmachen!

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