responsive design with stagescale

  • Hi,
    I found mul(stagescale,x); could be very helpful with responsibility of VT design

    recently I am using something like that:


    <action name="resizing">
    if((stageheight LE 800) AND (stageheight GT600), mul(stagescale,0.8););
    if((stageheight LE 600) AND (stageheight GT 500), mul(stagescale,0.6););
    if((stageheight LE 500), mul(stagescale,0.5););
    </action>

    it works fine when loading the tour, but it doesn´t work if I turn the tablet or smartphone from e.g. desktop orientation to portrait one. For that I tried to put this action to
    even onresize:


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

    But when doing this, seems that the mul action will take effect each time when I load new panorama in the tour and the siye of my layout shrinks each time *wacko*


    I tried to use instead of math operator mul(stagescale,0.8); action set(stagescale,0.8); but this unfortunately does not work *sad* (Excuse my ignorance if this doesn´t have any logic for you, I´m not really a programmer *tongue* ).

    Does anybody have an idea how to overcome this problem? I just simply want to have some exact scaling with particular stageheight. How to do that?
    Thanx for the help!

    Best regards,
    Igor Socha

  • uff I´m sorry, I tried it few days ago and it was not working, returned to it today and it works!

    however i found another problem with my approach - now I can use my action as onresize event and it works with downscaling but not the oposite way *confused*

    Best regards,
    Igor Socha

  • Here I found some stagescale testing example:
    https://krpano.com/examples/116/e…scale-test.html

    and by changing the stagescale also the stagesize is changing.
    According to what I see in this example, it seems that if I have e.g. full HD monitor 1920x1080px, by using e.g. set(stagescale, 0.5); now krpano considers it as double resolution, right? So this is why my code works for downscaling but not in opposite direction?

    Best regards,
    Igor Socha

  • is not correct krpano code

    correct would be :

    no no, there are two types of events:

    • The global krpano events

    These are the events that were defined in <events> elements without a name attribute. There can be always only one global event. When there is another <events> element in the xml with the same events the previously defined events were overwritten.

    Note - when loading an other xml file or another scene, all global events will remain and be unchanged unless they are defined again in the new xml or scene.

    • Independent local krpano events

    When an <events> element in the xml will be defined with a name attribute - then this will be an independent events element.
    It can contain any of the events, but they will not overwrite the global events, they will be called additionally to it.
    These 'named' <events> elements have also a keep attribute (with the default value "false"). That means <events> elements without keep="true" will be automatically removed when an other pano will be loaded.


    https://krpano.com/docu/xml/#events

    Best regards,
    Igor Socha

Jetzt mitmachen!

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