Sie sind nicht angemeldet.

1

Donnerstag, 11. Februar 2010, 07:33

alle Polygon-Hotspots durch Button anzeigen und ausblenden lassen

Hallo zusammen,

habe mir in meinem Pano Polygon-Hotspots eingepflegt. Zur Veranschaulichung würde ich gerne mittels eines Buttons alle verfügbaren Buttons anzeigen lassen. Ein erneutes Drücken blendet sie wieder aus - das Überfahren mit der Maus lässt jeden einzelnen dann wieder erscheinen.
Momentan sieht meine Buttonleiste so aus. Hier soll die Hotspot-Funktion mit rein:

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
<!-- Navigations-Buttons Start -->
		<events onenterfullscreen="set(plugin[openfs].visible,false); set(plugin[closefs].visible,true);"
	    		onexitfullscreen ="set(plugin[openfs].visible,true);  set(plugin[closefs].visible,false);"
	    		/>	

		
		<textstyle name="buttonstyle" font="Vendana" fontsize="10" border="false" background="false" textcolor="0xFFFFFF" effect="glow(0x000000,0.7,4,2);dropshadow(2,45,0x000000,3,1);" />	     	
	     	
		<plugin name="left" 	align="bottom" x="-65"  y="10" url="%SWFPATH%/skin/buttons.jpg" 
				visible="true" keep="true" alpha="0" scale="0.7" crop=  "0|0|40|40" onovercrop=  "0|40|40|40" ondowncrop=  "0|80|40|40" blendmode="screen" ondown="set(movevectorx,-1);"  
				onup="set(movevectorx,0);" />
				
		<plugin name="right"	align="bottom" x="-35"  y="10" url="%SWFPATH%/skin/buttons.jpg" 
				visible="true" keep="true" alpha="0" scale="0.7" crop= "40|0|40|40" onovercrop= "40|40|40|40" ondowncrop= "40|80|40|40" blendmode="screen" ondown="set(movevectorx,+1);"  
				onup="set(movevectorx,0);" />
				
		<plugin name="openfs"   align="bottom" x="-5" y="10" url="%SWFPATH%/skin/buttons.jpg" 
				visible="true" keep="true" alpha="0" scale="0.7" crop="280|0|40|40" onovercrop="280|40|40|40" ondowncrop="280|80|40|40" blendmode="screen" onhover="showtext(Vollbild, buttonstyle);" onclick="set(fullscreen,true);"  visible="true"  />
				
		<plugin name="closefs"  align="bottom" x="-5" y="10" url="%SWFPATH%/skin/buttons.jpg" 
				visible="true" keep="true" alpha="0" scale="0.7" crop="320|0|40|40" onovercrop="320|40|40|40" ondowncrop="320|80|40|40" blendmode="screen" onhover="showtext(Vollbild beenden,buttonstyle);"  
				onclick="set(fullscreen,false);" visible="false" />
				
<action name="startrotation">
  if(plugin[rotation].rotationenabled, set(autorotate.enabled,true) );
</action>

<action name="stoprotation">
  set(autorotate.enabled,false);
</action>

<action name="changerotation">
  <!-- bei jedem Klick umschalten: -->
  switch(plugin[rotation].rotationenabled);
  
  <!-- die aktuelle Einstellung auch nach autorotate.enabled kopieren: -->
  copy(autorotate.enabled, plugin[rotation].rotationenabled);
</action>


<!-- Navigations-Buttons Ende -->


und hier ein exemplarischer Hotspot: - es gibt noch 10 weitere....

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<hotspot name="hs0"
	     	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(1);"
	     	onout=""
	     	ondown=""
	     	onup=""
	     	onclick="action(showtextfield, textfield_hs0);"
	     	details="8"
	     	flying="0"
	     	inverserotation="false"
		>
		<point ath="-70.0579" atv="  2.8071" />
		<point ath="-69.9662" atv=" 20.6583" />
		<point ath="-65.0333" atv=" 21.2230" />
		<point ath="-65.0790" atv="  2.6720" />
	</hotspot>


ich habe schon verucht, die "borderalpha" des hotspots auf 1.0 zu setzen, jedoch scheint die Syntax nicht richtig zu sein. Hier mal mein Ansatz:

Quellcode

1
2
3
<plugin name="hotspots_visible"  align="bottom" x="..." y="..."  url="..." 
				visible="true"  keep="true" alpha="0" scale="0.7" crop="..."  onovercrop="..." ondowncrop="..." blendmode="screen"  onhover="showtext(alle hotspots einblenden,buttonstyle);"  
				 onclick="set([hotspot].borderalpha, 1.0);" visible="true" />


Hat jemand einen Tip?

Gruß
Matthias

2

Freitag, 19. Februar 2010, 07:33

weiß keiner Rat?

3

Montag, 22. Februar 2010, 15:02

Hi,

das ist gar nicht so einfach,
da die Polygon Hotspot Attribute wie "fillcolor", "fillcolorhover" nicht sofort beim setzen ausgewertet werden,

es gäbe aber die Möglichkeit die Hotspots über den normalen "alpha" Parameter ein- bzw. auszublenden,

wichtig dabei - die Farbe und Alphawerte des Hotspots sollten 'sichtbar' sein,
d.h. "fillalpha", "borderalpha" sollten nicht "0.0" sein,

hier ein Beispiel:
ein Einstellungen für alle Hotspots sind gleich zentral in einem <style> Tag gespeichert,
und dort wird in den "onover" und "onout" Events der "alpha" Wert verändert,

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
<style name="hotspotstyle"
   	fillcolor 	="0xffffff" fillalpha 	="0.10" borderwidth 	="2.0" bordercolor 	="0xffffff" borderalpha 	="0.80"
   	fillcolorhover="0xffffff" fillalphahover="0.10" borderwidthhover="4.0" bordercolorhover="0xffffff" borderalphahover="0.80"
   	alpha="0.0"
   	basealpha="0.0"
   	onover="tween(alpha,1.0);"
   	onout="tween(alpha,get(basealpha));"
   	/>

<hotspot name="hs1" style="hotspotstyle" onclick="">
	<point ath="-37.9542" atv=" -1.0540" />
	<point ath="-31.9367" atv=" 20.4756" />
	<point ath="-12.9528" atv=" 23.3669" />
	<point ath="-10.2040" atv="  3.7539" />
	<point ath="-21.9659" atv="-10.8500" />
</hotspot>

<hotspot name="hs2" style="hotspotstyle" onclick="">
	<point ath="  8.7175" atv=" -6.7645" />
	<point ath=" 12.2251" atv=" 17.8754" />
	<point ath=" 27.7743" atv=" 20.2370" />
	<point ath=" 40.2535" atv=" 13.4488" />
	<point ath=" 38.8920" atv=" -0.7432" />
	<point ath=" 30.9638" atv="-13.9647" />
</hotspot>


beim Überfahren eines Hotspots ändert sich der "alpha" Wert dabei zu "1.0" (=sichtbar),
und beim Verlassen zu"basealpha", welches zu Begin mit 0.0 (="unsichtbar") definiert ist,

jetzt ein Button und ein paar Aktionen zum Ein- bzw. Ausblenden aller Hotspots:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<plugin name="hotspotsbutton" 
    	...
    	onclick="toggle_all_hotspot_alpha_values();"
    	/>

<action name="toggle_all_hotspot_alpha_values">
	if(%1 != NEXT, set(i,0));
	toggle_hotspot_alpha(get(hotspot[%i].name));
	inc(i);
	if(i LT hotspot.count, toggle_all_hotspot_alpha_values(NEXT));
</action>

<action name="toggle_hotspot_alpha">
	switch(hotspot[%1].basealpha, 0.0, 1.0);
	tween(hotspot[%1].alpha, get(hotspot[%1].basealpha));
</action>


hier werden alle Hotspots durchlaufen, und der "basealpha" Wert entweder auf "0.0" oder "1.0" gesetzt,
immer umgekehrt zum vorherigen Wert, und dann wird "alpha" auf "basealpha" geändert,
dadurch werden die Hotspots dann bei jeden Aufruf (bzw. Buttonklick) immer ein- bzw. ausblendet,

Schöne Grüße,
Klaus