You are not logged in.

  • "Adrian Salisbury" started this thread

Posts: 62

Location: Peterborough, UK

Occupation: Virtual Tour Photographer

  • Send private message

1

Wednesday, June 4th 2014, 12:37pm

Turn on/off all hotspots at once

Ok, so I didn't get any takers on my last post and maybe I'm pushing the functionality of these tours but I wonder if someone could help me write the code for this, I'm thinking it's straight forward if you know what you're doing.

The same tour http://burghley.smartvirtualtours.com/first-george/ is peppered with hotspots and I'd like to have a button in the bottom bar to turn them on or off. The buttons are controlled by this style on line 32

<style name="spot-photo" url="skin/open-photo4.png" scale="0.3" alpha="0.7" handcursor="true" zoom="true" align="center" edge="center" />

Presumably if I set visible="true" then a command under the button could change it to false. I'd be ok if it were a layer or a hotspot but I'm not sure how to control a style, or if I even can?

I'd love some help please someone. I really do struggle with the coding and am so thankful for this forum.

Files
http://burghley.smartvirtualtours.com/first-george/
http://burghley.smartvirtualtours.com/first-george/tour.xml (style name="spot-photo" on line 32)
http://burghley.smartvirtualtours.com/fi…bar-include.xml
Many thanks,

Adrian Salisbury, UK
Smart Virtual Tours

Tuur

Sage

Posts: 3,191

Location: Netherlands

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

  • Send private message

2

Wednesday, June 4th 2014, 1:59pm

Hi,

there are different options but this one works fine for sure.

http://www.krpano.com/forum/wbb/index.ph…37519#post37519

so:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
<action name="HideHotspots">
for(set(i, 0), i LT hotspot.count, inc(i),
      if(hotspot[get(i)].hide == yes,
            helperaction(get(i));

      );
);  
</action>

<action name="helperaction">
  switch(hotspot[%1].visible);
</action>


Don't forget to put in the hotspot : hide="yes"

but maybe try also

set(hotspot.visible,false);
not sure if that still works (html5 etc..

Hope it helps

Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

This post has been edited 1 times, last edit by "Tuur" (Jun 4th 2014, 2:19pm)


Umalo

Professional

Posts: 1,048

Location: Osijek, Croatia, EU

  • Send private message

3

Wednesday, June 4th 2014, 2:05pm

Source code

1
2
3
4
5
6
7
8
9
10
11
<!-- Button -->
<layer name="skin_btn_hsa" style="buttons_base|skin_glow" crop="128|128|64|64" align="bottom" x="+20" y="3" scale="0.5" onclick="toggle_hotspots();"/>

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

<!--  Toggle Hotspots  -->
<action name="toggle_hotspots">
  if(hots_off === null, set(hots_off, true); show_hotspots(false);	 , if(hots_off === false, set(hots_off,true);	 show_hotspots(false); , set(hots_off,false);	 show_hotspots(true); ) );
</action>

  • "Adrian Salisbury" started this thread

Posts: 62

Location: Peterborough, UK

Occupation: Virtual Tour Photographer

  • Send private message

4

Wednesday, June 4th 2014, 3:13pm

Thanks guys, I'm a little lost in this and as Umalo has messaged me offering help I think I'm going to go down this route. I'm already over my head and should have a called in a developer I think lol! Although I love creating tours I am far from a programmer and have full respect for you guys on here who know what you're doing.

Tuur, again, thanks for your time here but I'll see what Umalo can offer before I wade into this.
Many thanks,

Adrian Salisbury, UK
Smart Virtual Tours

Similar threads