Get Hotspot onClick by code

  • Hi, I would know if I can intercept the onClick actions of Hotspost by this code

    Thanks
    Mau

  • Hi Klaus thanks,
    with onclick I would like to call his onclick action for loadscene

    I try with this

    Code
    callwith(hs,onclick(););

    but it does not call the scene related to the intercepted hotspot

    Mau

  • I also needed this, to be able to toggle the onclick event from code.
    You can achieve this based on the documentation:

    callwith(hs,onclick); - Note: you have to remove the ();


    If you want to have the effect from external javascript:
    krpano.call("callwith(hotspot["+hs+"], onclick);");

  • Finally I managed, but you can enter a time before the click occurs, to allow the user moving not to enter a new pano?

    my code

    Code
    <action name="checkhotspots">
    for(set(asz,0), asz LT hotspot.count, inc(asz), copy(hs, hotspot[get(asz)]); 
    hs.getcenter(hs_h, hs_v); 
    getlooktodistance(d, hs_h, hs_v); 
    if(d LT 2, set(hs.hovering, true);
    <!--code for delay --> 
    callwith(hs,onclick); , set(hs.hovering, false);
    ); ); 
    </action>

    Thx Mau

  • Finally I managed, but you can enter a time before the click occurs, to allow the user moving not to enter a new pano?

    my code

    Code
    for(set(asz,0), asz LT hotspot.count, inc(asz), copy(hs, hotspot[get(asz)]); 
    hs.getcenter(hs_h, hs_v); 
    getlooktodistance(d, hs_h, hs_v); 
    if(d LT 2, set(hs.hovering, true);
     
    callwith(hs,onclick); , set(hs.hovering, false);
    ); );

    Thx Mau

    Still doesn't make sense on what you want to do.

    1. to enter a new pano, use loadscene() - pre-defined action.
    2. 'code for delay', use delayedcall() - pre-defined action. if you set a id of the dealyedcall, you may stop the call.

  • Still doesn't make sense on what you want to do.


    Why does not it make sense?

    I would like the hotspot connected to open after a period of time when the hotspot itself is in the middle of the screen.

    As it is now the script as soon as the function responds positively calls the onclick action, ie it goes to the linked scene.

    What I would like to do is the same functionality that exists in the webVR mode

    I tried with Delayedcall but it not works.

    Thanks Mau

Jetzt mitmachen!

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