Stop lookto with code

  • Hi,

    I have a project with a javascript wrapper for krpano api.
    With my JS wrapper, i can call an action written in the config.xml. It is a sequence of lookto for explaining 360 interaction to user before starting the tour.

    Code
    <action name="help-drag">
    		oninterrupt('reset-help');
    		wait(1);
    		lookto(40,0,120,linear(20));
    		lookto(17.5,0,120,linear(20));
    		lookto(17.5,-17.5,120,linear(20));
    		lookto(17.5,20,120,linear(20));
    		lookto(0,0,120,linear(30));
    	</action>

    The user can stop this sequence by closing the overlay, but i want to stop the action sequence too.

    It seems that calling the other action named 'reset-help' which has this code :

    Code
    <action name="reset-help">
    		showlog(true);
    		stopall();
    		breakall();
    	</action>

    doesn't arrive directly, but after the first lookto sequence.

    It seems that the oninterrupt does work just for user interaction and not code blocking stuff.

    Any advice for my feature ?

  • Hi,

    right - oninterrupt works only for user-interactions, when calling from Javascript during blocking, the actions from the call will be put into a queue of actions and executed when the current blocking actions were done...

    A way to work around this, might be using non-blocking lookto calls and some custom user blocking (e.g. big invisible layer on top).

    A non-blocking lookto call can be stopped by calling again a non-blocking lookto with the current view coordinates - e.g.

    Code
    lookto(get(view.hlookat),get(view.vlookat),get(view.fov),true,true);

    Best regards,
    Klaus

Participate now!

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