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