|
@@ -0,0 +1,64 @@
|
|
|
+<!--
|
|
|
+ krpano - compass example
|
|
|
+ - it rotates images accordingly to the viewing direction
|
|
|
+-->
|
|
|
+
|
|
|
+<krpano>
|
|
|
+
|
|
|
+ <!-- compass with rotating pointer -->
|
|
|
+ <!-- <layer name="compass1" visible="true" keep="true" url="%SWFPATH%/compass/compass_bg.png" align="righttop" x="150" y="10" children="false" scalechildren="true" destscale="1.0" onclick="switch(destscale,1.0,0.5);tween(scale,get(destscale));">
|
|
|
+ <layer name="compass1_plate" url="%SWFPATH%/compass/compass_plate.png" align="center" zorder="1" />
|
|
|
+ <layer name="compass1_pointer" url="%SWFPATH%/compass/compass_pointer.png" align="center" zorder="2" />
|
|
|
+ <layer name="compass1_ring" url="%SWFPATH%/compass/compass_ring.png" align="lefttop" zorder="3" />
|
|
|
+ </layer>
|
|
|
+ -->
|
|
|
+ <!-- compass with rotating plate -->
|
|
|
+ <layer name="compass2" visible="true" keep="true" url="%SWFPATH%/compass/compass_bg.png" align="righttop" x="15" y="15" children="false" scalechildren="true" scale="0.8">
|
|
|
+ <layer name="compass2_plate" url="%SWFPATH%/compass/compass_plate.png" align="center" zorder="1" />
|
|
|
+ <layer name="compass2_pointer" url="%SWFPATH%/compass/compass_pointer.png" align="center" zorder="2" />
|
|
|
+ <layer name="compass2_ring" url="%SWFPATH%/compass/compass_ring.png" align="lefttop" zorder="3" />
|
|
|
+ </layer>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- view changing eeent -->
|
|
|
+ <events name="compass_events" keep="true" onviewchange="compass_update_rotate();" />
|
|
|
+ <!-- update the rotation values -->
|
|
|
+ <action name="compass_update_rotate">
|
|
|
+ trace('compass_update_rotate');
|
|
|
+ set(global_heading, 180);
|
|
|
+ calc(plugin[compass1_pointer].rotate, view.hlookat - global_heading);
|
|
|
+ calc(plugin[compass2_plate].rotate, global_heading - view.hlookat);
|
|
|
+ </action>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- add some hotspots -->
|
|
|
+ <!-- <action name="add_compass_spots" autorun="onstart">
|
|
|
+ showlog();
|
|
|
+
|
|
|
+ set(layer[compass2].visible,true);
|
|
|
+ addspot(n, 0, 0|0| 76|76, 1.0);
|
|
|
+ addspot(no, 45, 78|0|118|76, 0.5);
|
|
|
+ addspot(o, 90, 202|0| 71|76, 1.0);
|
|
|
+ addspot(so, 135, 281|0|109|76, 0.5);
|
|
|
+ addspot(s, 180, 400|0| 69|76, 1.0);
|
|
|
+ addspot(sw, 225, 469|0|134|76, 0.5);
|
|
|
+ addspot(w, 270, 603|0| 86|76, 1.0);
|
|
|
+ addspot(nw, 315, 689|0|141|76, 0.5);
|
|
|
+ </action> -->
|
|
|
+
|
|
|
+ <!-- <action name="addspot">
|
|
|
+ addhotspot(%1);
|
|
|
+ set(hotspot[%1].url, '%SWFPATH%/compass/hotspots.png');
|
|
|
+ set(hotspot[%1].crop, '%3');
|
|
|
+ set(hotspot[%1].ath, %2);
|
|
|
+ set(hotspot[%1].atv, 0);
|
|
|
+ set(hotspot[%1].scale, %4);
|
|
|
+ set(hotspot[%1].scale1, %4);
|
|
|
+ calc(hotspot[%1].scale2, %4 * 2);
|
|
|
+ set(hotspot[%1].zoom,true);
|
|
|
+ set(hotspot[%1].onover, tween(scale,get(scale2)); );
|
|
|
+ set(hotspot[%1].onout, tween(scale,get(scale1)); );
|
|
|
+ set(hotspot[%1].onclick, lookto(get(ath),get(atv),90); );
|
|
|
+ </action> -->
|
|
|
+
|
|
|
+</krpano>
|