Skip to content

Instantly share code, notes, and snippets.

@hellonicolas
Created February 27, 2015 22:59
Show Gist options
  • Save hellonicolas/d93c6e8d26846a7edd62 to your computer and use it in GitHub Desktop.
Save hellonicolas/d93c6e8d26846a7edd62 to your computer and use it in GitHub Desktop.
<!--
krpano
- animated hotspots example
- for Flash and HTML5
-->
<krpano>
<!-- pano -->
<preview url="../../panos/p2/preview.jpg" />
<image>
<cube url="../../panos/p2/pano_%s.jpg" />
</image>
<!-- view settings -->
<view hlookat="0" vlookat="0" fovtype="MFOV" fov="90" fovmin="60" fovmax="120" />
<!-- hotspot style predefines - black hotspot -->
<style name="hotspot_ani_black"
url="hotspot_ani_black_64x64x20.png"
crop="0|0|64|64"
framewidth="64" frameheight="64" frame="0" lastframe="19"
onloaded="hotspot_animate();"
/>
<!-- hotspot style predefines - white hotspot -->
<style name="hotspot_ani_white"
url="hotspot_ani_white_64x64x20.png"
crop="0|0|64|64"
framewidth="64" frameheight="64" frame="0" lastframe="19"
onloaded="hotspot_animate();"
/>
<!-- hotspot animation action -->
<action name="hotspot_animate">
inc(frame,1,get(lastframe),0);
mul(ypos,frame,frameheight);
txtadd(crop,'0|',get(ypos),'|',get(framewidth),'|',get(frameheight));
delayedcall(0.03, if(loaded, hotspot_animate() ) );
</action>
<!-- example hotspots -->
<hotspot name="spot1" style="hotspot_ani_black" ath="-25" atv="-10" onclick="showlog(); trace('hotspot ',get(name),' clicked');" />
<hotspot name="spot2" style="hotspot_ani_black" ath="-15" atv="+10" onclick="showlog(); trace('hotspot ',get(name),' clicked');" />
<hotspot name="spot3" style="hotspot_ani_white" ath="+15" atv="-10" onclick="showlog(); trace('hotspot ',get(name),' clicked');" />
<hotspot name="spot4" style="hotspot_ani_white" ath="+25" atv="+10" onclick="showlog(); trace('hotspot ',get(name),' clicked');" />
</krpano>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment