Multiple conditions

  • Hi,
    I'm relativaly new with KRPanoplayer (Ex FPP) and I have the following question.
    Is it possible to use multiple conditions in the scripting?
    I have a mutiframe panotour with pano's that took place at different dates. I have made images of the calendar dates in the pano.
    I'd like to, when the user changes the pano, the image of the date will change too. I tried it this way...

    <action name="checkdate">
    if(image.frame == 1,set(plugin[calendar].url,images/calendar_1.png),
    image.frame == 2,set(plugin[calendar].url,images/calendar_2.png),
    image.frame == 3,set(plugin[calendar].url,images/calendar_3.png)
    );
    </action>

    But it doesn't work. Can somebody help me further?
    Thanks in advance,
    Yvan.

  • you could use if/else and nest them

    Code
    if(condition, trueaction, falseaction);


    So your code would be

  • try:

  • Zephyr and pinsane..

    thank you for the code... id try it and it works... my question would be how to shortened this code

    <action name="hotspot3d">
    if(image.frame == 3, set(hotspot[hs1].visible,true) );
    if(image.frame LT 3, set(hotspot[hs1].visible,false) );
    if(image.frame GT 3, set(hotspot[hs1].visible,false) );
    </action>

    mean i want the only frame 3 that have hotspot etc and if move to next or previous frame the hotspot will disappear..

    regrads

    bulp

  • i want the only frame 3 that have hotspot etc and if move to next or previous frame the hotspot will disappear..

    This will make the hotspot only appear for frame 3:

    Code
    <action name="hotspot3d">
    	if(image.frame == 3, set(hotspot[hs1].visible,true);,set(hotspot[hs1].visible,false););
    </action>

    The action hotspot3d should be called immediately after the frame is incremented or decremented. For instance, if your are using the multiframeskin.xml found in the krpanotools template/skin directory, hotspot3d would immediately follow the inc and dec calls found in the nextframe and prevframe actions respectively.

    (Let's see if Zephir and I post simultaneously again! *wink* )

    steve

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!