How to hide a Groupe of Hotspots with a TAG

  • Hi,

    I'm trying to hide and unhide a groupe a Hotspot with a Tag.

    Here is my code :

    I creat the Action

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


    I creat a button that will hide and unhide the Groupe of Hostpot

    Code
    <layer name="Hotspotsniveau1" url="images/user_male.png" align="leftttop" x="5" y="150" scale="0.5"  keep="true" zorder="-1" onclick="switch(hideHotSpotsNiveau1)"/>


    I creat a hotspot with the Tag

    Code
    <hotspot name="spot4" style="skin_hotspotstyle" ath="5.307" atv="19.451" linkedscene="scene_villa-suar1" tag="hs" visible=""/>

    Thanks a lot for your help and feedback. :)

  • I have another problem :

    I have several Scene, When I click to activate the Hotspot with the Tag "niveau1" it works with One Scene.

    Now If I go to the second scene and go back to the First Scene all the Hotspot with the tag "niveau1" are not visible.

    How can I solve this ?

    Here is my code :

    This Layer Show and Hide the Hotspots with the Tag "HS"

    Code
    <layer name="Hotspotsniveau1" url="images/user_male.png" align="leftttop" onhover="showtext(Administrateur,info-bulle)"  x="5" y="150" scale="0.5"
    keep="true" zorder="-1" onclick="for(set(i,0), i LT hotspot.count, inc(i),if(hotspot[get(i)].tag == niveau1, switch(hotspot[get(i)].visible,false,true)););"/>

    Here is the code to the Hotspot

    Code
    <hotspot name="spot6" style="skin_hotspotstyle" ath="68.087" atv="-8.345" linkedscene="salon-prive" tag="niveau1" visible="false" />

    Thanks for your help. *wink*

  • Here is the code :

    Code
    <style name="skin_hotspotstyle" url="vtourskin_hotspot.png" scale="0.5" edge="top" oy="0" distorted="false"
    	   	tooltip=""
    	   	onclick="if(linkedscene, skin_hidetooltips(); tween(scale,0.25,0.5); tween(oy,-20,0.5); tween(alpha,0,0.5); looktohotspot(); loadscene(get(linkedscene),null,MERGE,BLEND(1)); skin_updatescroll(); );"
    	   	onloaded="if(skin_settings.tooltips_hotspots, if(linkedscene, copy(tooltip,scene[get(linkedscene)].title); loadstyle(skin_tooltips); ));"
    	   	/>
  • Aha. Your style is pretty much the Krpano's style for arrows with no keep="true" attrbute set. That mean when next scene is loaded all this hotspots are removed from memory as most problably you don't want to see arrows from previous room in e.g bathroom. This what you want is little bit more complex. You would need to set keep="true" and introduce hotspots visibility handler which will trigger on e.g. event onnewpano. There you will need additional attribute to keep current visibility status to know should one hotpost be currently visible or not. This is influenced by current scene loaded and based on previous action like you use to hide/show based on tagging. Go in this direction and let us know about your progress.

Jetzt mitmachen!

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