|
|
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 |
<events onviewchange="show_hotspots_in_range()"
/>
<action name="show_hotspots_in_range">
set(i,0);
loop_hotspots(0);
</action>
<action name="loop_hotspots">
test_hotspot_in_range(get(hotspot[%1].name));
inc(i);
if (i LT hotspot.count, loop_hotspots( get(i) ) );
</action>
<action name="test_hotspot_in_range">
sub(hdistance, view.hlookat, hotspot[%1].ath);
mod(hdistance,hdistance,360);
sub(vdistance, view.vlookat, hotspot[%1].atv);
mod(vdistance,vdistance,360);
if(hdistance LT 0, mul(hdistance,hdistance,-1));
if(vdistance LT 0, mul(vdistance,vdistance,-1));
if(hdistance GT 25, set(hdistance,25) );
if(vdistance GT 25, set(vdistance,25) );
div(hdistance,hdistance,25);
div(vdistance,vdistance,25);
add(distance2,hdistance,vdistance);
sub(hotspot[%1].alpha,1.0,distance2);
if(hotspot[%1].alpha LT 0.2, set(hotspot[%1].alpha,0.2) );
</action>
|

|
|
Quellcode |
1 |
if(hotspot[%1].alpha LT 0.2, set(hotspot[%1].alpha,0.2) ); |
Zitat
that could be very easy done via plugin:
loop through all hotspots,
check the distance between the hotspot ath/atv and the view hlookat/vlookat,
and change the alhpa of the hotspot accordingly,
Benutzerinformationen überspringen
Wohnort: Wellington, New Zealand
Beruf: Trying to build an entire walkthrough of NZ for tourists
no, this shouldn't be necessary...it seems you must call updatescreen() after changing parameters of poly-spots in order to get the desired effect
Is there a way of making this work with poly hotspots?
Benutzerinformationen überspringen
Wohnort: Wellington, New Zealand
Beruf: Trying to build an entire walkthrough of NZ for tourists
Hi, can you describe that a bit more?if I add ath/atv values to a poly hotspot it overrides the over coordinates and only works on the hotspot graphic, which isn't much use.
|
|
Quellcode |
1 2 3 4 5 |
<hotspot ... ath=".." atv=".."> <point ... /> <point ... /> ... </hotspot> |
Benutzerinformationen überspringen
Wohnort: Wellington, New Zealand
Beruf: Trying to build an entire walkthrough of NZ for tourists
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
<hotspot name="pier2beach"
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.30" borderwidthhover="0.0" bordercolorhover="0xffffff" borderalphahover="0.00"
onover="hs_text()"
url="%SWFPATH%/hs.png"
scale="0.3"
ath="-266"
atv="-1"
onhover=""
onout=""
ondown="hs(beach,beach2ferry)"
onup=""
onclick=""
flying="0">
<point ath=" 85.3296" atv=" -3.1666" /><point ath="111.7186" atv=" -3.1227" /><point ath="111.7009" atv=" 0.7309" /><point ath="104.4062" atv=" 1.7199" /><point ath="106.9587" atv=" 3.3946" /><point ath="104.0284" atv=" 4.0171" /><point ath=" 79.6806" atv=" 4.2831" /><point ath=" 84.9391" atv=" 0.9845" />
</hotspot>
|
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
<hotspot name="pier2ferry" 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.30" borderwidthhover="0.0" bordercolorhover="0xffffff" borderalphahover="0.00" onover="hs_text()" onhover="" onout="" ondown="hs(ferry,ferry2pier)" onup="" onclick="" flying="0"> <point ath="178.2174" atv=" -1.4540" /><point ath="-125.5751" atv=" 0.1901" /><point ath="-126.1102" atv=" 11.4175" /><point ath="-151.2046" atv=" 21.4357" /><point ath="177.8108" atv=" 2.4959" /><point ath="173.8779" atv=" 1.6940" /><point ath="174.0857" atv=" -0.0742" /><point ath="177.6207" atv=" 0.1228" /> </hotspot> <hotspot name="pier2ferry_button" keep="false" visible="true" enabled="false" handcursor="true" capture="true" children="true" url="%SWFPATH%/hs.png" scale="0.4" zoom="true" zorder="0" ath="-150" atv="0"> </hotspot> |
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
<hotspot name="pier2ferry"
ath="-150"
atv="0"
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.30" borderwidthhover="0.0" bordercolorhover="0xffffff" borderalphahover="0.00"
onover="hs_text()"
onhover=""
onout=""
ondown="hs(ferry,ferry2pier)"
onup=""
onclick=""
flying="0">
<point ath="178.2174" atv=" -1.4540" /><point ath="-125.5751" atv=" 0.1901" /><point ath="-126.1102" atv=" 11.4175" /><point ath="-151.2046" atv=" 21.4357" /><point ath="177.8108" atv=" 2.4959" /><point ath="173.8779" atv=" 1.6940" /><point ath="174.0857" atv=" -0.0742" /><point ath="177.6207" atv=" 0.1228" />
</hotspot>
|
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »bulp« (1. September 2009, 17:49)
Benutzerinformationen überspringen
Wohnort: Wellington, New Zealand
Beruf: Trying to build an entire walkthrough of NZ for tourists
Klaus,doing it in that way doesn't work? (ath/atv in the polygonal hotspot)
|
|
Quellcode |
1 |
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »viewinz« (16. September 2009, 10:51)
Hi,EDIT: Actually what I want is a textfield that fades in/out and is located by the ath/atv of the hotspot, and there could be multiple hotspots in the view. Can you help me adjust your code to do something like that?
Benutzerinformationen überspringen
Wohnort: Wellington, New Zealand
Beruf: Trying to build an entire walkthrough of NZ for tourists
Hi,A work around is to have a child hotspot with a graphic.
Is there another way of doing this?
Benutzerinformationen überspringen
Wohnort: Wellington, New Zealand
Beruf: Trying to build an entire walkthrough of NZ for tourists
|
|
Quellcode |
1 2 3 |
set(i,0);loop_hotspots(0); test_hotspot_in_range(get(hotspot[%1].name));inc(i);if (i LT hotspot.count, loop_hotspots( get(i) ) ); sub(hdistance, view.hlookat, hotspot[%1].ath);mod(hdistance,hdistance,360);sub(vdistance, view.vlookat, hotspot[%1].atv);mod(vdistance,vdistance,360);if(hdistance LT 0, mul(hdistance,hdistance,-1));if(vdistance LT 0, mul(vdistance,vdistance,-1));if(hdistance GT 100, set(hdistance,80) );if(vdistance GT 100, set(vdistance,80) );div(hdistance,hdistance,80);div(vdistance,vdistance,80);add(distance2,hdistance,vdistance);sub(hotspot[%1].alpha,1.0,distance2);if(hotspot[%1].alpha LT 0.2, set(hotspot[%1].alpha,0.0) ); |