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

Zitat
No Steve,
what I would like is to show polygonal hotspots, that generally by default are invisible unless mouse rollover.
|
|
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> |
|
|
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>
|
and congratulation for that code...
Zitat
I'm trying to find a way to maintain the hotspots on/off also if I change panorama.
|
|
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>
|
|
|
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>
|