Sie sind nicht angemeldet.

tonesh

Schüler

  • »tonesh« ist der Autor dieses Themas

Beiträge: 75

Wohnort: Rome

Beruf: Photographer

  • Nachricht senden

1

Freitag, 26. Februar 2010, 18:50

Make visible polygon hotspots

Hello,
I'm trying to control the visibility of polygon hotspots (something like the old QTVR, where there was a button to show/hide ALL hotspots).
I thought a good way was to change the "fillalpha" parameter.

I CANNOT just have this(something similar to the switch(hotspot.visible) for POINT hotspot):

Quellcode

1
onclick="set(hotspot.fillalpha,1) " 

it doesn't work!
This works, but just for the specified hotspot:

Quellcode

1
onclick="set(hotspot[hs1].fillalpha,1) "

(and it doesn't work really nicely, as I have to click on the pano to see the change).

I would like to show/hide ALL polygonal hotspots in the pano.

Any idea?
Thanks

Toni

2

Freitag, 26. Februar 2010, 19:51

Normally you would be able to use a 'all' parameter, or you can parent all the hotspots to a plugin (as far as i know parenting only controls position,rotation and scale, but i can be wrong since i'm a beginner).

there is offcourse another option to set all hotspots manually, or (i dont know it's possible) use a while-statement. You can number all hotspots like HS1, HS2, HS3... and apply the alpha.

I think Klaus knows how to do this.

hope this helps,

Declan

3

Freitag, 26. Februar 2010, 21:25

set(hotspot.visible,false) will turn all hotspots off. Is that what you want?

You can attach this action to the onclick parameter of a button (a plugin). See Klaus' example here (the star button does what you want):

http://www.krpano.com/examples/buttons/

steve

4

Freitag, 26. Februar 2010, 23:59

Thank You, Pinsane. I have been looking for that and for some reason always overlooked that feature. I was planning on writing code for each hotspot to get that function but have been too lazy to do it. Putting something off until later paid off after all. *g*

Having this on the plugin works great.

onclick="switch(hotspot.visible);"

tonesh

Schüler

  • »tonesh« ist der Autor dieses Themas

Beiträge: 75

Wohnort: Rome

Beruf: Photographer

  • Nachricht senden

5

Samstag, 27. Februar 2010, 01:54

No Steve,
what I would like is to show polygonal hotspots, that generally by default are invisible unless mouse rollover.
I do not want to turn off them, just to set the parameter fillalpha for all of them.
This because I think that is the only way to make visible a polygonal hotspot...
..and I don't know if it is possible...

What you are saying is correct if you have image hotspot.
With : onclick="switch(hotspot.visible);" you can show/hide only Image hotspots because you show/hide the embedded image...but polygonal hotspots doesn't have any image attached.

Toni

6

Samstag, 27. Februar 2010, 02:37

I have found that if the hotspot is already visible whether it is a poly ( with the alpha something other than 0 ) or an image, it will dissapear when using that snippet of code. However, if it is not visible on start, it does not make it visible.

7

Samstag, 27. Februar 2010, 05:28

Zitat

No Steve,
what I would like is to show polygonal hotspots, that generally by default are invisible unless mouse rollover.

Sometimes an xml is worth a thousand words. This xml shows polygonal hotspots which have a low alpha value that is boosted when the mouse is moved over them. The star button at the bottom toggles all of the hotspots.

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<krpano version="1.0.8" >
	<plugin name="hotspot_button"
		url="%SWFPATH%../skin/buttons.jpg"
		visible="true"
		align="bottom"
		edge="center"
		y="40"
		x="0"
		crop="240|0|40|40"
		blendmode="screen"
		onover="set(blendmode,add);"
		onout="set(blendmode,screen);"
		onhover="showtext(show/hide hotspots);"
		onclick="switch(hotspot.visible);" />

	<preview type="grid(cube,16,16,512,0xCCCCCC,0x444444,0x999999);" details="16" />

	<hotspot name="hs1"
	         keep="false"
	         visible="true" enabled="true" handcursor="true" capture="true" children="true"
 	         zorder="0"
	         fillcolor     ="0xff0000" fillalpha     ="0.2" borderwidth     ="0.1" bordercolor     ="0xffffff" borderalpha     ="0.00"
	         fillcolorhover="0x00ffff" fillalphahover="0.30" borderwidthhover="4.0" bordercolorhover="0xffffff" borderalphahover="0.80"
	         fadeintime="0.150" fadeouttime="0.300" fadeincurve="1.100" fadeoutcurve="0.700"
		>
		<point ath="  7.6410" atv=" 44.2540" />
		<point ath="-18.9274" atv=" 32.5275" />
		<point ath="-11.8606" atv=" 21.7660" />
		<point ath=" -3.8127" atv=" 22.9592" />
		<point ath="  9.7815" atv=" 19.7682" />
	</hotspot>

	<hotspot name="hs2"
	         keep="false"
	         visible="true" enabled="true" handcursor="true" capture="true" children="true"
 	         zorder="0"
	         fillcolor     ="0x777700" fillalpha     ="0.20" borderwidth     ="0.0" bordercolor     ="0xffffff" borderalpha     ="0.00"
	         fillcolorhover="0xff0000" fillalphahover="0.50" borderwidthhover="4.0" bordercolorhover="0xffffff" borderalphahover="0.80"
	         fadeintime="0.150" fadeouttime="0.300" fadeincurve="1.100" fadeoutcurve="0.700"
		>
		<point ath=" 17.0468" atv=" -8.7491" />
		<point ath=" -1.8198" atv=" -8.3987" />
		<point ath=" -1.6000" atv="-15.2135" />
		<point ath=" 33.8519" atv="-15.4927" />
	</hotspot>

	<hotspot name="hs3"
	         keep="false"
	         visible="true" enabled="true" handcursor="true" capture="true" children="true"
 	         zorder="0"
	         fillcolor     ="0x0000ff" fillalpha     ="0.20" borderwidth     ="0.0" bordercolor     ="0xffffff" borderalpha     ="0.00"
	         fillcolorhover="0x00ffff" fillalphahover="0.50" borderwidthhover="4.0" bordercolorhover="0xffffff" borderalphahover="0.80"
	         fadeintime="0.150" fadeouttime="0.300" fadeincurve="1.100" fadeoutcurve="0.700"
		>
		<point ath="-38.2232" atv="  6.7263" />
		<point ath="-27.2820" atv="  6.3757" />
		<point ath="-26.8563" atv="-10.4005" />
		<point ath="-33.0202" atv=" -7.5373" />
		<point ath="-39.3512" atv=" -0.8895" />
		<point ath="-34.7540" atv="  1.4206" />
	</hotspot>
</krpano>


If you have a mix of image hotspots and polygonal hotspots and you only want to turn off the polygonal ones, let me know. I've got a foreach function that should do the trick!

hope this helps!

steve

tonesh

Schüler

  • »tonesh« ist der Autor dieses Themas

Beiträge: 75

Wohnort: Rome

Beruf: Photographer

  • Nachricht senden

8

Samstag, 27. Februar 2010, 12:48

Thank you Steve,
maybe I have to explain better what I would like to do, and I found a partial solution:
here the example I mean:

http://www.studioargento.com/examples/hotspot/

1) I would like to have ALL hotspots to be active, visible or not.
So I can't use switch(hotspot.visible), as it makes hotspots not working,
even if this is a solution to hide/show them.

2) I found that the code: switch(hotspot[hs1].fillalpha,0.5,0) works,
but only if I add: set(update,view). *thumbsup*

so the complete code would be:
onclick="switch(hotspot[hs1].fillalpha,0.5,0); set(update,view);"

This could be the solution, I can set in this way the alpha, color, bordercolor, etc of the hotspots,
but now remains the problem that works just for 1 hotspot, the one named HS1.

As I'm not skilled programmer, I don't know how to make a function that counts all the
hotspots in the pano and apply the switch. Every pano has a different number of hotspots,
and the button to hide/show hotspots is in the global.xml.

As Declan says, "use a while-statement"...yes, but how?

thanks all

Toni

9

Samstag, 27. Februar 2010, 14:48

Quellcode

1
onclick="switch(hotspot[%1].fillalpha,0.5,0); set(update,view);"

try this ;-)

10

Samstag, 27. Februar 2010, 19:41

Toni,

Okay, I think I get what you want. There is no built in looping function in the krpano action language, but it is possible to build one.

If I understand you correctly, this xml should do what you want:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<krpano version="1.0.8" >

	<action name="toggle_polygonal_hotspots">
		foreach(hotspot,i,
			toggle_alpha(get(i));
		);
		set(update,view);
	</action>

	<action name="toggle_alpha"> <!--index.num-->
		if (hotspot[%1].point.count != 0,	<!--a polygonal hotspot-->
			switch(hotspot[%1].fillalpha,0,0.2);
		);
	</action>

	<!--	_foreach_action
		private function to execute foreach loop body action -->
	<action name="_foreach_action">
		trace("Error in foreach loop: push/pop stack corrupted"); <!-- this line should never execute -->
	</action>
	<!--	foreach <objectid> <index.str> <body.str>
		foreach loop function which iterates the action across each of the objects-->
	<action name="foreach"> <!--objectid.str,index.str,body.str-->
		set(%2,0);
		push(action[_foreach_action].content);
		set(action[_foreach_action].content,"if(%2 LT %1.count,%3;inc(%2);_foreach_action(););");
		_foreach_action();
		pop(action[_foreach_action].content);
	</action>

	<plugin name="hotspot_button"
		url="%SWFPATH%../skin/buttons.jpg"
		visible="true"
		align="bottom"
		edge="center"
		y="40"
		x="0"
		crop="240|0|40|40"
		blendmode="screen"
		onover="set(blendmode,add);"
		onout="set(blendmode,screen);"
		onhover="showtext(show/hide hotspots);"
		onclick="toggle_polygonal_hotspots();" />

	<preview type="grid(cube,16,16,512,0xCCCCCC,0x444444,0x999999);" details="16" />

	<hotspot name="hs1"
	         keep="false"
	         visible="true" enabled="true" handcursor="true" capture="true" children="true"
 	         zorder="0"
	         fillcolor     ="0xff0000" fillalpha     ="0.2" borderwidth     ="0.1" bordercolor     ="0xffffff" borderalpha     ="0.00"
	         fillcolorhover="0x00ffff" fillalphahover="0.30" borderwidthhover="4.0" bordercolorhover="0xffffff" borderalphahover="0.80"
	         fadeintime="0.150" fadeouttime="0.300" fadeincurve="1.100" fadeoutcurve="0.700"
		>
		<point ath="  7.6410" atv=" 44.2540" />
		<point ath="-18.9274" atv=" 32.5275" />
		<point ath="-11.8606" atv=" 21.7660" />
		<point ath=" -3.8127" atv=" 22.9592" />
		<point ath="  9.7815" atv=" 19.7682" />
	</hotspot>

	<hotspot name="hs2"
	         keep="false"
	         visible="true" enabled="true" handcursor="true" capture="true" children="true"
 	         zorder="0"
	         fillcolor     ="0x777700" fillalpha     ="0.20" borderwidth     ="0.0" bordercolor     ="0xffffff" borderalpha     ="0.00"
	         fillcolorhover="0xff0000" fillalphahover="0.50" borderwidthhover="4.0" bordercolorhover="0xffffff" borderalphahover="0.80"
	         fadeintime="0.150" fadeouttime="0.300" fadeincurve="1.100" fadeoutcurve="0.700"
		>
		<point ath=" 17.0468" atv=" -8.7491" />
		<point ath=" -1.8198" atv=" -8.3987" />
		<point ath=" -1.6000" atv="-15.2135" />
		<point ath=" 33.8519" atv="-15.4927" />
	</hotspot>

	<hotspot name="hs3"
	         keep="false"
	         visible="true" enabled="true" handcursor="true" capture="true" children="true"
 	         zorder="0"
	         fillcolor     ="0x0000ff" fillalpha     ="0.20" borderwidth     ="0.0" bordercolor     ="0xffffff" borderalpha     ="0.00"
	         fillcolorhover="0x00ffff" fillalphahover="0.50" borderwidthhover="4.0" bordercolorhover="0xffffff" borderalphahover="0.80"
	         fadeintime="0.150" fadeouttime="0.300" fadeincurve="1.100" fadeoutcurve="0.700"
		>
		<point ath="-38.2232" atv="  6.7263" />
		<point ath="-27.2820" atv="  6.3757" />
		<point ath="-26.8563" atv="-10.4005" />
		<point ath="-33.0202" atv=" -7.5373" />
		<point ath="-39.3512" atv=" -0.8895" />
		<point ath="-34.7540" atv="  1.4206" />
	</hotspot>
	<hotspot name="centerfront"
	         url="%SWFPATH%../plugins/hotspot_ani_white.swf"
	         ath="0"
	         atv="5.14"
	         keep="false"
	         visible="true" enabled="true" handcursor="true" capture="true" children="true"
 	         zorder="0"
	         fillcolor     ="0xffffff" fillalpha     ="0.00" borderwidth     ="0.0" bordercolor     ="0xffffff" borderalpha     ="0.00"
	         fillcolorhover="0xffffff" fillalphahover="0.10" borderwidthhover="4.0" bordercolorhover="0xffffff" borderalphahover="0.80"
	         fadeintime="0.150" fadeouttime="0.300" fadeincurve="1.100" fadeoutcurve="0.700"
	         onover=""
	         onhover="showtext(This is a non-polygonal hotspot)"
	         onout=""
	         ondown=""
	         onclick="set(view.fovmin,5);looktohotspot(centerfront,10);loadpano(pagg_centerfront.xml,null,KEEPBASE|NOPREVIEW,BLEND(2),push(autorotate.enabled);set(autorotate.enabled,false);push(view.fovmin);set(view.fovmin,50.34);lookat(38.45,24.01,50.34);wait(blend);lookto(0,0,65,smooth(100,100,100));pop(view.fovmin);pop(autorotate.enabled))"
	         onup=""
		>
	</hotspot>
</krpano>


best regards,

steve

11

Samstag, 27. Februar 2010, 20:50

Hi Pinsane,

Interesting piece of code that does exactly what Toni required *thumbup* ...

I was not aware of the possibility to count the points of an hotspot. Now I am...
It was interesting for me to try to understand how the foreach() and _foreach_action() worked...

Thank you to share *smile* and congratulation for that code...

SAlut.

tonesh

Schüler

  • »tonesh« ist der Autor dieses Themas

Beiträge: 75

Wohnort: Rome

Beruf: Photographer

  • Nachricht senden

12

Sonntag, 28. Februar 2010, 17:27

THANKS A LOT STEVE,
a nice professional piece of code! *thumbup*
and I could easily add to the fillalpha, a fillcolor parameter.

I'm trying to find a way to maintain the hotspots on/off also if I change panorama.

http://www.studioargento.com/examples/hotspot/example2.html

now, I have to admit my total ignorance on syntax, I think that it can be resolved
by setting a variable ( on/off) when clicking the hotspot button,
and when loading the other panorama, to read it and apply the action if the variable is (on).
What is the best (working) method, use of set/get functions?

Thanks again, hope this thread is useful for those who want to have the old style QTVR hotspots behavior...

Toni

13

Montag, 1. März 2010, 09:48

Hey Toni!

I'm pleased the code solved your problem.

Zitat

I'm trying to find a way to maintain the hotspots on/off also if I change panorama.

I do this on my tours. You are correct, a setting a variable is a good way to solve the problem. You can test for the variable in the onxmlloaded event, and then set the alpha values accordingly.

I've found that rather than using a toggle function (as we implemented in the code above) it's better to have two functions, a sethotspotson and a sethotspotsoff. Either strategy will work, but having separate functions is cleaner and more straightforward.

Here's some sample code, this file should be named sethotspots1.xml:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<krpano version="1.0.8" >

	<events onxmlcomplete="action(onxmlcomplete);" />
	<action name="onxmlcomplete">
		if(hotspots==true,action(sethotspotson),action(sethotspotsoff));
	</action>
	<action name="sethotspotson">
		set(hotspots,true);
		foreach(hotspot,i,
			set_hotspot_alpha_high(get(i));
		);
		set(update,view);
		set(plugin[hotspotoff].visible,true);
		set(plugin[hotspoton].visible,false);
	</action>
	<action name="sethotspotsoff">
		set(hotspots,false);
		foreach(hotspot,i,
			set_hotspot_alpha_low(get(i));
		);
		set(update,view);
		set(plugin[hotspotoff].visible,false);
		set(plugin[hotspoton].visible,true);
	</action>
	<action name="set_hotspot_alpha_high"> <!--index.num-->
		if (hotspot[%1].point.count != 0,	<!--a polygonal hotspot-->
			set(hotspot[%1].fillalpha,0.3);
		);
	</action>

	<action name="set_hotspot_alpha_low"> <!--index.num-->
		if (hotspot[%1].point.count != 0,	<!--a polygonal hotspot-->
			set(hotspot[%1].fillalpha,0);
		);
	</action>

	<!--	_foreach_action
		private function to execute foreach loop body action -->
	<action name="_foreach_action">
		trace("Error in foreach loop: push/pop stack corrupted"); <!-- this line should never execute -->
	</action>
	<!--	foreach <objectid> <index.str> <body.str>
		foreach loop function which iterates the action across each of the objects-->
	<action name="foreach"> <!--objectid.str,index.str,body.str-->
		set(%2,0);
		push(action[_foreach_action].content);
		set(action[_foreach_action].content,"if(%2 LT %1.count,%3;inc(%2);_foreach_action(););");
		_foreach_action();
		pop(action[_foreach_action].content);
	</action>
	<plugin name="hotspoton"
		url="%SWFPATH%../skin/buttons.jpg"
		visible="true"
		align="bottom"
		edge="center"
		y="40"
		x="0"
		crop="160|0|40|40" onovercrop="160|40|40|40" ondowncrop="160|80|40|40"
		blendmode="screen"
		onover="set(blendmode,add);"
		onout="set(blendmode,screen);"
		onhover="showtext(click to show hotspots);"
		onclick="sethotspotson();" />
	<plugin name="hotspotoff"
		url="%SWFPATH%../skin/buttons.jpg"
		visible="true"
		align="bottom"
		edge="center"
		y="40"
		x="0"
		crop="200|0|40|40" onovercrop="200|40|40|40" ondowncrop="200|80|40|40"
		blendmode="screen"
		onover="set(blendmode,add);"
		onout="set(blendmode,screen);"
		onhover="showtext(click to hide hotspots);"
		onclick="sethotspotsoff();" />

	<preview type="grid(cube,16,16,512,0xCCCCCC,0x444444,0x999999);" details="16" />

	<hotspot name="hs1"
	         keep="false"
		   onclick="loadpano(sethotspots2.xml,null,MERGE,BLEND(2),;);"
	         visible="true" enabled="true" handcursor="true" capture="true" children="true"
 	         zorder="0"
	         fillcolor     ="0xff0000" fillalpha     ="0.2" borderwidth     ="0.1" bordercolor     ="0xffffff" borderalpha     ="0.00"
	         fillcolorhover="0x00ffff" fillalphahover="0.30" borderwidthhover="4.0" bordercolorhover="0xffffff" borderalphahover="0.80"
	         fadeintime="0.150" fadeouttime="0.300" fadeincurve="1.100" fadeoutcurve="0.700"
		>
		<point ath="  7.6410" atv=" 44.2540" />
		<point ath="-18.9274" atv=" 32.5275" />
		<point ath="-11.8606" atv=" 21.7660" />
		<point ath=" -3.8127" atv=" 22.9592" />
		<point ath="  9.7815" atv=" 19.7682" />
	</hotspot>

	<hotspot name="hs2"
	         keep="false"
		   onclick="loadpano(sethotspots2.xml,null,MERGE,BLEND(2),;);"
	         visible="true" enabled="true" handcursor="true" capture="true" children="true"
 	         zorder="0"
	         fillcolor     ="0x777700" fillalpha     ="0.20" borderwidth     ="0.0" bordercolor     ="0xffffff" borderalpha     ="0.00"
	         fillcolorhover="0xff0000" fillalphahover="0.50" borderwidthhover="4.0" bordercolorhover="0xffffff" borderalphahover="0.80"
	         fadeintime="0.150" fadeouttime="0.300" fadeincurve="1.100" fadeoutcurve="0.700"
		>
		<point ath=" 17.0468" atv=" -8.7491" />
		<point ath=" -1.8198" atv=" -8.3987" />
		<point ath=" -1.6000" atv="-15.2135" />
		<point ath=" 33.8519" atv="-15.4927" />
	</hotspot>
</krpano>


this file should be called sethotspots2.xml

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<krpano version="1.0.8" >

	<events onxmlcomplete="action(onxmlcomplete);" />
	<action name="onxmlcomplete">
trace("onxmlcomplete hotspots=",hotspots);
		if(hotspots==true,action(sethotspotson),action(sethotspotsoff));
	</action>
	<action name="sethotspotson">
		set(hotspots,true);
		foreach(hotspot,i,
			set_hotspot_alpha_high(get(i));
		);
		set(update,view);
		set(plugin[hotspotoff].visible,true);
		set(plugin[hotspoton].visible,false);
	</action>
	<action name="sethotspotsoff">
		set(hotspots,false);
		foreach(hotspot,i,
			set_hotspot_alpha_low(get(i));
		);
		set(update,view);
		set(plugin[hotspotoff].visible,false);
		set(plugin[hotspoton].visible,true);
	</action>
	<action name="set_hotspot_alpha_high"> <!--index.num-->
		if (hotspot[%1].point.count != 0,	<!--a polygonal hotspot-->
			set(hotspot[%1].fillalpha,0.3);
		);
	</action>

	<action name="set_hotspot_alpha_low"> <!--index.num-->
		if (hotspot[%1].point.count != 0,	<!--a polygonal hotspot-->
			set(hotspot[%1].fillalpha,0);
		);
	</action>

	<!--	_foreach_action
		private function to execute foreach loop body action -->
	<action name="_foreach_action">
		trace("Error in foreach loop: push/pop stack corrupted"); <!-- this line should never execute -->
	</action>
	<!--	foreach <objectid> <index.str> <body.str>
		foreach loop function which iterates the action across each of the objects-->
	<action name="foreach"> <!--objectid.str,index.str,body.str-->
		set(%2,0);
		push(action[_foreach_action].content);
		set(action[_foreach_action].content,"if(%2 LT %1.count,%3;inc(%2);_foreach_action(););");
		_foreach_action();
		pop(action[_foreach_action].content);
	</action>
	<plugin name="hotspoton"
		url="%SWFPATH%../skin/buttons.jpg"
		visible="true"
		align="bottom"
		edge="center"
		y="40"
		x="0"
		crop="160|0|40|40" onovercrop="160|40|40|40" ondowncrop="160|80|40|40"
		blendmode="screen"
		onover="set(blendmode,add);"
		onout="set(blendmode,screen);"
		onhover="showtext(click to show hotspots);"
		onclick="sethotspotson();" />
	<plugin name="hotspotoff"
		url="%SWFPATH%../skin/buttons.jpg"
		visible="true"
		align="bottom"
		edge="center"
		y="40"
		x="0"
		crop="200|0|40|40" onovercrop="200|40|40|40" ondowncrop="200|80|40|40"
		blendmode="screen"
		onover="set(blendmode,add);"
		onout="set(blendmode,screen);"
		onhover="showtext(click to hide hotspots);"
		onclick="sethotspotsoff();" />

	<preview type="grid(cube,16,16,512,0x000000,0x444444,0x999999);" details="16" />

	<hotspot name="hs1"
	         keep="false"
		   onclick="loadpano(sethotspots1.xml,null,MERGE,BLEND(2),;);"
	         visible="true" enabled="true" handcursor="true" capture="true" children="true"
 	         zorder="0"
	         fillcolor     ="0xff0000" fillalpha     ="0.2" borderwidth     ="0.1" bordercolor     ="0xffffff" borderalpha     ="0.00"
	         fillcolorhover="0x00ffff" fillalphahover="0.30" borderwidthhover="4.0" bordercolorhover="0xffffff" borderalphahover="0.80"
	         fadeintime="0.150" fadeouttime="0.300" fadeincurve="1.100" fadeoutcurve="0.700"
		>
		<point ath="  7.6410" atv=" 4.2540" />
		<point ath="-18.9274" atv=" 20.5275" />
		<point ath="-11.8606" atv=" 30.7660" />
		<point ath=" -3.8127" atv=" 25.9592" />
		<point ath="  9.7815" atv=" 10.7682" />
	</hotspot>

	<hotspot name="hs2"
	         keep="false"
		   onclick="loadpano(sethotspots1.xml,null,MERGE,BLEND(2),;);"
	         visible="true" enabled="true" handcursor="true" capture="true" children="true"
 	         zorder="0"
	         fillcolor     ="0x777700" fillalpha     ="0.20" borderwidth     ="0.0" bordercolor     ="0xffffff" borderalpha     ="0.00"
	         fillcolorhover="0xff0000" fillalphahover="0.50" borderwidthhover="4.0" bordercolorhover="0xffffff" borderalphahover="0.80"
	         fadeintime="0.150" fadeouttime="0.300" fadeincurve="1.100" fadeoutcurve="0.700"
		>
		<point ath=" 7.0468" atv=" -5.7491" />
		<point ath=" -10.8198" atv=" -10.3987" />
		<point ath=" 4.6000" atv="-25.2135" />
		<point ath=" 30.8519" atv="-20.4927" />
	</hotspot>
</krpano>


You'll see that the hotspot status is maintained from pano to pano.

Good luck!

steve

tonesh

Schüler

  • »tonesh« ist der Autor dieses Themas

Beiträge: 75

Wohnort: Rome

Beruf: Photographer

  • Nachricht senden

14

Montag, 1. März 2010, 21:24

Steve:

YESSS !!!! *thumbsup* *thumbsup*

Your code is exactly what I was meaning for a Polygonal Hotspot Visibility Behavior:

a) is possible to show/hide ALL hotspots, without taking care about how many they are for each pano, or what name they have.
b) hotspots are still active
c) is possible to set ALL the parameters referred to the polygonal hotspot, as fillalpha, fillcolor, borderwidth, bordercolor...
d) hotspot hide/show state remains the same loading another pano.

example3

(I just detached from each sethotspots1.xml and sethotspots2.xml the common code and include it into the defaultskin.xml)

Thanks again

Best regards

Toni

15

Dienstag, 2. März 2010, 00:29

I'm happy this met your needs.

By the way, great photography on your site!

steve