Alle Hotspots per Button ein- und ausblenden

  • Über dieses Thema habe ich einiges gelesen und komme trotzdem nicht weiter. Folgendes habe ich bereits stehen.

    <style name="a" url="skin/Hotspot.png" keep="true" edge="top" width="120" height="120" alpha="0.7" onhover="showtext(Hotspot An/Aus);" onout="tween(alpha,0.7,1);"/>
    <layer name="Hotspot_aus_an" style="a" crop="0|448|64|64" align="right" x="50" y="0" scale="0.5" onclick="Hotspot_aus_an()" />

    <action name="Hotspot_aus_an">
    for( set(i, 0), i LT hotspot.count, inc(i),
    set( hotspot[get(i)].visible, false);
    );
    </action>

    Bis hier funktioniert alles bestens und alle Hotspots sind ausgeblendet. Das einblenden funktioniert aber nicht.
    Wenn ich jetzt wie auf https://krpano.com/forum/wbb/inde…ot%5B#post68953 beschrieben folgendes einsetze

    if( hotspot.count,

    switch( hotspot[0].visible);

    for( set(i, 1), i LT hotspot.count, inc(i),

    copy( hotspot[get(i)].visible, hotspot[0].visible);

    );

    );

    blendet es beim ersten Klick mittig ein Steuerkreuz ein und am unteren Rand zwei Doppelpfeile. Beim zweiten Klick ist alles inclusive Hotspots verschwunden. Beim nächsten Klick ist alles wieder da. Wie bekommen ich das Steuerkreuz und die beiden Doppelpfeile weg.

  • Ich habe jetzt den Buttom in die Steuerleiste integriert und folgendes stehen.

    <layer name="Hot_aus_an" style="a" align="center" x="+126" y="0" scale="0.5" onhover="showtext(Hotspots ein/ausblenden);" onclick="hideallhotspots();" />

    <action name="hideallhotspots">
    if( hotspot.count,
    switch( hotspot[0].visible);
    for( set(i, 1), i LT hotspot.count, inc(i),
    copy( hotspot[get(i)].visible, hotspot[0].visible);
    );
    );
    </action>

    Leider kommt es immer noch zu einer Fehldarstellung. Hat denn keiner eine Idee. Ich benutze Krpano 1.19-VR8.
    Habe noch 4 Bilder mit der Darstellung angehangen.

    P.S. Habe gerade herausgefunden das es im Editor funktioniert nur in der Tour nicht.

  • Das sind die VR-Buttons, die sollten im Desktop-Mode nicht da sein!

    Du mußt die Action hideallhotspots erweitern, so das nur die "richtigen" HS ein-/ausgeblendet werden und nicht alle!

    Alle relevanten HS bekommen ein weiteres Attribut zB cat="hs_einaus".

    Code
    <action name="hideallhotspots">
         if( hotspot.count,
              switch( hotspot[0].visible);
              for( set(i, 1), i LT hotspot.count, inc(i),
                   if( get(hotspot[get(i)].cat) == "hs_einaus",
                        copy( hotspot[get(i)].visible, hotspot[0].visible);
                   );
              );
         );
    </action>


    (ungestestet)

  • Klappt leider nicht. Die Pfeile nach rechts und das Mittelkreuz ist verschwunden, Pfeile nach links sind noch da. Der Hotspot blendet auch nicht mehr aus. Im Editor ist alles bestens.

  • Hier handelt es sich wahrscheinlich um einen Programmfehler.
    Habe das ganze jetzt mit Version 1.18 wie oben beschrieben probiert und es funktioniert bestens. Ab Version 1.19 tritt dann der genannte Fehler auf.

  • Although I understand some German, I could miss the point, will try to help here. Your issue comes from the point that in recent versions 1.19 for VR mode there are hotspots created which are usually not visible. They are activated when VR mode is turned on. Due to that fact your actions that are toggling visibility of all hotspots should be adapted to tweak only hotspots you want. Or other way: Not toggling VR hotspots. If you list hotspots in memory you will see all of them and then you choose what is best option for you.
    Another issue can be in style of the hotspots keep last style loaded. E.g. When tooltips are used skin_hotspotstyle is not keeping that as style but skin_tooltips so this is to be covered too.

Participate now!

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