You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Monday, March 2nd 2015, 12:32pm

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

Source code

1
2
3
4
5
6
7
<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

Source code

1
<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

Source code

1
<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. :)

Tuur

Sage

Posts: 3,323

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

3

Monday, March 2nd 2015, 1:40pm

Hi Tuur,

Thanks for the link but I don't understand what's wrong in my code ?

Can you help me ? I'm lost. *blink*

Thanks.

5

Monday, March 2nd 2015, 4:14pm

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"

Source code

1
2
<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

Source code

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


Thanks for your help. ;-)

Umalo

Professional

Posts: 1,048

Location: Osijek, Croatia, EU

  • Send private message

6

Tuesday, March 3rd 2015, 10:55am

Does your style skin_hotspotstyle have keep="true" IF not than this is normal that they are hidden as they are created when new scene is loaded and you see you have visible set to false.

7

Tuesday, March 3rd 2015, 2:04pm

Hi Umalo,

Thanks for your feedback but I don't understand what you mean. *confused*

Umalo

Professional

Posts: 1,048

Location: Osijek, Croatia, EU

  • Send private message

8

Tuesday, March 3rd 2015, 5:50pm

Can you share link to this code to see how your style is defined?

9

Wednesday, March 4th 2015, 9:12am

Here is the code :

Source code

1
2
3
4
5
<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); ));"
	   	/>

Umalo

Professional

Posts: 1,048

Location: Osijek, Croatia, EU

  • Send private message

10

Wednesday, March 4th 2015, 10:36am

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.