How to unload dynamicaly loaded <style> in Krpano?

  • Hi there,

    How can I unload <style> added to <hotspot> dynamically?

    When I assign style to hotspot I use

    Code
    hotspot.loadstyle( @style_name@);

    method, but how can I remove/unload this style without deleting or replacing hotspot itself?

    Thanks, looking forwad to get reply from you.
    Regards,
    Maksim

  • when a style is applied to an element (i.e. hotspot)
    all its attributes are copied to the target, except for attributes already set on the target.
    there is no unloadstyle() because it is impossible to know what was set on the original hotspot after this procedure.

    but to go back to the original state you could maybe backup and restore your hotspot
    something like...

    copy(hotspot[example_bak], hotspot[example]);
    set(hotspot[example_bak], visible, false);
    hotspot[example].loadstyle(style_name);
    ...
    copy(hotspot[example], hotspot[example_bak]);
    set(hotspot[example], visible, true);
    delete(hotspot[example_bak]);


    ... completely untested *rolleyes*

  • Thanks for your suggestion, I did it a little bit different but algorithm is closed to yours. But unfortunetely, when I remove previous hotspot and replace it with new one it blinks for a couple of mileseconds. Do you have any ideas, how can I get rid of this side effect, I mean the blink itself?
    Regards,
    Maksim

Jetzt mitmachen!

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