Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.
Location: Netherlands
Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer
![]() |
Source code |
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 |
<scene name="scene_1" autoload="true" title="a1" onstart=""> <preview type="grid(cube,16,16,512,0xCCCCCC,0x666666,0x999999);" details="16"/> <hotspot type="text" html="clickme" name="colorspot" ath="10" atv="0" width="100" height="100" bgcolor="0xff0000" onclick="swapcolor(colorspot)"></hotspot> <hotspot type="text" html="lookatme" name="colorspot2" ath="90" atv="0" width="100" height="100" bgcolor="0xff0000"></hotspot> </scene> <action name="swapcolor" args="name"> trace(get(name)); set(hs, get(hotspot[get(name)])); if (hs.bgcolor == "0xff0000", set(hs.bgcolor, "0x00ff00"), set(hs.bgcolor,"0xff0000")); </action> <events name="check_viewathotspot_colorspot2" keep="true" onviewchanged="togglehotspot"/> <action name="togglehotspot" scope="local"> getlooktodistance(current_angle, hotspot[colorspot2].ath, hotspot[colorspot2].atv); set(hs, get(hotspot[colorspot2])); if (current_angle LT 20, <!-- dosomething when hotspot is in viewing range --> set(hs.bgcolor, "0x00ff00"); , set(hs.bgcolor, "0xff0000"); ); trace(get(current_angle)); </action> |
This post has been edited 1 times, last edit by "nikonutsch" (Jan 3rd 2023, 9:26pm)
![]() |
Source code |
1 |
getlooktodistance(current_angle, hotspot[oapv_foto].ath, hotspot[oapv_photo].atv); |
![]() |
Source code |
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 |
<events name="check_viewathotspot" keep="true" onviewchanged="togglehotspot"/> <action name="togglehotspot" scope="local"> getlooktodistance(current_angle, hotspot[oapv_foto].ath,hotspot[oapv_foto].atv); set(hs, get(hotspot[oapv_foto])); if (current_angle LT 30, <!-- dosomething when hotspot is in viewing range --> set(hs.alpha, "1"); , set(hs.alpha, "0"); ); trace(get(current_angle)); getlooktodistance(current_angle, hotspot[ao_f].ath, hotspot[ao_f].atv); set(hs, get(hotspot[ao_f])); if (current_angle LT 30, <!-- dosomething when hotspot is in viewing range --> set(hs.alpha, "1"); , set(hs.alpha, "0"); ); trace(get(current_angle)); </action> |
![]() |
Source code |
1 2 3 4 5 6 7 8 9 |
onloaded="drag()" ox="0" drag="adjusthlookat(10); if( (ath LT calc(view.hlookat + 30)) AND (ath GT calc(view.hlookat - 30)), if(ox == 0, tween(ox, -750)); , if(ox == -750, tween(ox, 0)); ); delayedcall(0.01, if(drag, drag()) ); " |
![]() |
Source code |
1 2 3 4 5 6 7 8 9 |
onloaded="drag()" ox="0" drag="getlooktodistance(cur_angle, ath, atv); if( cur_angle LE 30, tween(ox, -200); , tween(ox, 0); ); delayedcall(0.01, if(drag, drag()) ); " |
This post has been edited 2 times, last edit by "San7" (Jan 4th 2023, 7:35pm)
dear San7
thank you for this great solution. it makes working with a lot of hotspots much easier!!!!!!!!!!!!!
![]() |
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
<events name="check_viewathotspot" keep="true" onviewchanged="slideingdoor"/> <action name="slideingdoor"> for(set(i,0), i LT hotspot.count, inc(i), copy(hs,hotspot[get(i)]); hs.getcenter(hs_h, hs_v); getlooktodistance(d, hs_h, hs_v); subtxt(destVar,get(hs.name),0, 1); if(destVar == "x", if(d LT 40, set(hs.ox, 200); , set(hs.ox, -200); ); ); ); </action> |
![]() |
Source code |
1 2 3 4 5 6 7 8 9 10 11 |
<action name="slideingdoor"> for(set(i,0), i LT hotspot.count, inc(i), copy(hs,hotspot[get(i)]); hs.getcenter(hs_h, hs_v); getlooktodistance(d, hs_h, hs_v); subtxt(destVar,get(hs.name),0, 1); if(destVar == "x", if(d LT 40, tween(hs.ox, 200,3); , tween(hs.ox, -200,3); );); ); </action> |
This post has been edited 2 times, last edit by "nikonutsch" (Jan 10th 2023, 11:49am)
with this code i can get all hotspots with x at the beginning of the title
This post has been edited 3 times, last edit by "indexofrefraction" (Jan 9th 2023, 11:25pm)
![]() |
Source code |
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 |
<hotspot name="x_sd1" type="image" url="skin/türop1.jpg" keep="false" renderer="webgl" visible="true" enabled="true" capture="false" handcursor="true" cursor="pointer" maskchildren="false" zorder="" style="" ath="00" atv="0.000" edge="center" zoom="false" distorted="true" rx="0.0" ry="0.0" rz="0.0" width="500" height="800" scale="1" rotate="0" alpha="1" so="-1500" sc="1100" /> |
![]() |
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
<events name="check_viewathotspot" keep="true" onviewchanged="slidingdoor"/> <action name="slidingdoor"> for(set(i,0), i LT hotspot.count, inc(i), copy(hs,hotspot[get(i)]); hs.getcenter(hs_h, hs_v); getlooktodistance(d, hs_h, hs_v); subtxt(destVar,get(hs.name),0, 1); if(destVar == "x", if(d LT 40, tween(hotspot[get(hs.name)].ox, get(hotspot[get(hs.name)].so) ,3); , tween(hotspot[get(hs.name)].ox, get(hotspot[get(hs.name)].sc) ,3); ); ); ); </action> |
This post has been edited 3 times, last edit by "nikonutsch" (Jan 10th 2023, 1:07pm)