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

Sunday, November 9th 2008, 9:20am

Any way to swap one button for another on an event other than fullscreen?

This code works great for switching the button graphic that appears when in and out of fullscreen... is there an "event" that would allow me to do the same for switching the graphic for the "hotspots button"...

Basically I was hoping to find a clean way to have an illuminated graphic appear when the hotspots are on, and a darker graphic appear when the hotspots are off ("turn hotspots on", "turn hotspots off").

TIA- Blake

============================================

<plugin name="openfs"
url="btn_openfs.png"
visible="true"
alpha="0.85"
align="bottom"
edge="center"
y="40"
x="+120"
blendmode="normal"
onhover="showtext(enter fullscreen);"
onover="set(blendmode,add);"
onout="set(blendmode,normal);"
onclick="set(fullscreen, true);"/>

<plugin name="closefs"
url="btn_closefs.png"
visible="false"
alpha="0.85"
align="bottom"
edge="center"
y="40"
x="+120"
blendmode="normal"
onhover="showtext(exit fullscreen);"
onover="set(blendmode,add);"
onout="set(blendmode,normal);"
onclick="set(fullscreen, false);"/>

<events onenterfullscreen="set(plugin[openfs].visible,false); set(plugin[closefs].visible,true);"
onexitfullscreen="set(plugin[openfs].visible,true); set(plugin[closefs].visible,false);"/>

2

Sunday, November 9th 2008, 2:44pm

Hi,

are two possibilities:

1. use two buttons (recommended solution)
  • one button to hide the hotspots
  • the other to show it
  • both buttons are on the same position
  • only one button is visible at the moment
  • on clicking one button, the visibility of the buttons is swapped
example source:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<plugin name="hs_off"  
	url="btn_hs_off.jpg" visible="true"
	align="bottom" edge="center" y="40" x="+80" blendmode="screen" 
	onhover="showtext(Hide Hotspots);"   
	onover="set(blendmode,add);"  
	onout="set(blendmode,screen);" 
	onclick="set(visible,false);
		set(plugin[hs_on].visible,true);
		set(hotspot.visible,false);" 
	/>
<plugin name="hs_on"   
	url="btn_hs_on.jpg" visible="false"
	align="bottom" edge="center" y="40" x="+80" blendmode="screen"
	onhover="showtext(Show Hotspots);"   
	onover="set(blendmode,add);"  
	onout="set(blendmode,screen);" 
	onclick="set(visible,false);
		set(plugin[hs_off].visible,true);
		set(hotspot.visible,true);" 
	/>



2. or use only one button and switch the image of it

example source:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<plugin name="hs"  
	url="btn_hs_off.jpg" 
	align="bottom" edge="center" y="40" x="+80" blendmode="screen" 
	onover="set(blendmode,add);"  
	onout="set(blendmode,screen);" 
	onloaded="action(show_hs_hidebutton);"
	/>

<action name="show_hs_hidebutton">
	set(plugin[hs].onloaded,null);
	set(plugin[hs].url,btn_hs_off.jpg);
	set(plugin[hs].onhover, showtext(Hide Hotspots); );
	set(plugin[hs].onclick, set(hotspot.visible,false); action(show_hs_showbutton); );
</action>
	
<action name="show_hs_showbutton">
	set(plugin[hs].onloaded,null);
	set(plugin[hs].url,btn_hs_on.jpg);
	set(plugin[hs].onhover, showtext(Show Hotspots); );
	set(plugin[hs].onclick, set(hotspot.visible,true); action(show_hs_hidebutton); );
</action>


regards,
Klaus

3

Monday, November 10th 2008, 6:29am

Thanks Klaus - once again, excellent support! I used the first option - worked very well!

Similar threads