You are not logged in.

1

Tuesday, October 15th 2019, 1:56pm

Hide/show hotspots

Hello,
I have read a lot of posts about hide and show hotspots with no luck...

I just want to have a button to turn on and off the hotspots and I would like to use the hide/show skin button (that arrow looking down inside a circle on the right side of the skin bar). So when I hide the skin also the hotspots go away, in that way I have a "clean" view of the panorama.

I tryed to use Klaus codes and added them on the vtourskin.xml...I added the two actions for hide and show the hotspots, and added thouse actions on the "onclick" to the button of the show/hide skin:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
<layer name="skin_btn_hide"  	style="skin_base|skin_glow" crop="0|448|64|64"  align="right"   	x="50"   y="0"  scale="0.5" onclick="skin_hideskin(); hide_hotspots();" />
				<layer name="skin_btn_show" type="container" bgcapture="true" align="bottom" width="100%" height="get:skin_settings.controlbar_height" y="calc:skin_settings.controlbar_height - skin_settings.controlbar_offset_closed" onclick="skin_showskin(); show_hotspots();"  onhover="tween(alpha,1.0);" onout="tween(alpha,0.25);" ondown.touch="onhover();" onup.touch="onout();" visible="false" capture="false" alpha="0.0">
					<layer name="skin_btn_show_icon" style="skin_base" crop="64|448|64|64" scale="0.5" align="bottom" y="2" enabled="false" />
				</layer>
<action name="hide_hotspots"> 
 for(set(i,0), i LT hotspot.count, inc(i), set(hotspot[get(i)].visible,false);  );
</action>

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

When I click the button, it all works well, the skin and hotspots go away.... but when I click again to show again the skin and the hotspots, two new buttons (next and previous pano) and a cursor (pointer) in the middle of the screen appear...see image below



I have no idea of coding *wacko* ,so a bit of help would be really apreciated, thank you!

2

Tuesday, October 15th 2019, 2:58pm

Try using shutdown alpha instead of visible


set(hotspot[get(i)].alpha ,0);


set(hotspot[get(i)].alpha ,1);

3

Tuesday, October 15th 2019, 8:40pm

Try using shutdown alpha instead of visible


set(hotspot[get(i)].alpha ,0);


set(hotspot[get(i)].alpha ,1);


Thank you very much!
That worked as expected!

Now, just have one last question, as the hotspots are still active, if I click on them and go to the next panorama, they are visible again, but not the menu skin...is there a way to keep those hotspots hided when going through panoramas with the menu hided?

thanks again

4

Thursday, October 17th 2019, 1:52pm

noone can help me with this?

5

Sunday, October 20th 2019, 7:58am

Here is an example code for showing hotspots


For local hotspots, disconnection must be done at the start of the scene, because changes to the hotspot are not saved if you exit the scene

6

Monday, October 21st 2019, 1:46pm


Here is an example code for showing hotspots


For local hotspots, disconnection must be done at the start of the scene, because changes to the hotspot are not saved if you exit the scene


Thank you very much again...I tryed your code on the vtourskin.xml and then the tour could not be loaded...so I tryed it on the "tour.xml" but with no luck, the tour loads but it makes no difference...

Anyway I think that what I am trying to achieve is far more simple than this code...I do not need to save the states of the hotspots for the next time I open the scene (I guess when you say scene, is the whole virtual tour)...I am doing a virtual tour, so the problem is that when I hide the skin (and now thanks to you also the hotspots) and I go to the next panorama of the tour through a hotspot that is hidden, when the next panorama is loaded, the skin is hidden but the hotspots of this next panorama are visible...so is there a way to make the hotsposts and the skin to behave in the same way? in order to keep them hidden while the skin is also hidden...it is just to give the change to the user to see a "clean" panorama without any disturbing hotspots or menus in screen

thank you!

7

Monday, October 21st 2019, 1:52pm

You can change the hotspot while in an open scene, but if you exit and return to this scene, the hotspots will be set to the starting values, so you need to remember the state.
Make a flag for opening and closing hotspots and depending on the state of the flag when loading scenes, set the visibility of hotspots

8

Monday, October 21st 2019, 4:26pm


You can change the hotspot while in an open scene, but if you exit and return to this scene, the hotspots will be set to the starting values, so you need to remember the state.
Make a flag for opening and closing hotspots and depending on the state of the flag when loading scenes, set the visibility of hotspots



ok, I understand the logic of it, but as I have no coding skills at all, do not know how to do this flags, is there any example in the documentation or somewhere else to follow it and try to write that code?

thank you!

9

Monday, October 21st 2019, 8:06pm

<action name="startup" autorun="onstart">

set(show_hs, true);



Write on the button onclick="if(show_hs, set(show_hs,false); hide_hotspots();, set(show_hs,true); show_hotspots(); );"



in the scenes onstart="if(show_hs, set(show_hs,false); hide_hotspots();, set(show_hs,true); show_hotspots(); );"

10

Thursday, October 24th 2019, 4:13pm


<action name="startup" autorun="onstart">

set(show_hs, true);



Write on the button onclick="if(show_hs, set(show_hs,false); hide_hotspots();, set(show_hs,true); show_hotspots(); );"


in the scenes onstart="if(show_hs, set(show_hs,false); hide_hotspots();, set(show_hs,true); show_hotspots(); );"



THANK YOU very much!! *thumbsup* *thumbsup*

I had to add the same code to some other places, like the prev/next arrows, thumbails and also to the hide skin button, but at the end I managed to achieve what I was looking for!!

Similar threads