• I'm trying to create a plugin which will animate onover and return to frame 1 onout. Also, the animation must only run once i.e. frames 1 to 40 and stop.
    I can do this by using the standard krpano animate code and changing the 0 for 39 as follows:

    <action name="animate">
    inc(frame,1,get(frames),39);
    mul(ypos,frame,frameheight);
    txtadd(crop,'0|',get(ypos),'|',get(framewidth),'|',get(frameheight));
    delayedcall(0.06, animate() );
    </action>
    My problem is, I don't know how to get it to return to frame 1 onout so that it is ready for the next mouseover action.

    Any ideas anyone?

    Thanks

    Kev.

  • your minimum frame is 39?
    frames is unknown

    onout"set(frame,1);"

    I think your inc max and min are mixed up and don't even make sense if you don't want it to repeat.. the documentation says it loops using that.
    inc(variable,byvalue*,max*,min*)
    dec(variable,byvalue*,min*,max*)

    <action name="animate">
    ifnot (frame == 40,inc(frame,1));
    mul(ypos,frame,frameheight);
    txtadd(crop,'0|',get(ypos),'|',get(framewidth),'|',get(frameheight));
    delayedcall(0.06, animate() );
    </action>

  • Thanks Sacha,

    As you can tell, I'm learning by trial and error and don't have as much understanding of xml code as I would like. I found (by trial and error) that by changing the 0 to 39 (my number of frames) I got the effect I was looking for.
    The corrected code that you gave me also works however, the onout"set(frame,1);" is not working for me. Yes, it sets the plugin back to frame 1 but it immediately runs through the animate action again.
    What I need is for it to set to frame 1 so that it is ready to animate again onover.

    Kev

  • <action name="animate">
    ifnot (delaykilled ==true,
    ifnot (frame == 40,inc(frame,1));
    mul(ypos,frame,frameheight);
    txtadd(crop,'0|',get(ypos),'|',get(framewidth),'|',get(frameheight));
    delayedcall(0.06, animate() );
    );
    </action>


    onout"set(frame,1);set(delaykilled,true)"

    and before you animate();
    set(delaykilled,false);animate();

    Nothing really xml code here.. its just basic programming. My way is straightforward logic. I'm sure there is a cleverer method.
    Try reading some programming tutorials online and try to stop trial and error in favor of very slow understanding of what you are trying to achieve and think it through step by step. That's the only way to learn. I rebelled against learning to programming anything until about 6 years ago.. It was a futile effort.

  • go back to your animate action and
    onout="breakall();mul(ypos,1,frameheight);txtadd(crop,'0|',get(ypos),'|',get(framewidth),'|',get(frameheight));"

    would be even better since it would stop the running action, and reset the frame at the same time.
    Unless you have other actions running, then you have to go back to killing the action personally like I did before.

    <action name="animate">
    ifnot (frame == 40,inc(frame,1));
    mul(ypos,frame,frameheight);
    txtadd(crop,'0|',get(ypos),'|',get(framewidth),'|',get(frameheight));
    delayedcall(0.06, animate() );
    </action>

Participate now!

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