Hello,
I've got a hotspot in my scene. It's a png sequence that starts playing on mouse hover, then stops on the last frame. My issue is getting it to play backwards.
I tried reversing the png file and setting the hotspot url to the reversed png 'onout', but this didn't work very well. There was a gap that you can see when it switches out the url for the png.
Here's my code. My hotspot is called listen_pin, which has 7 frames (including frame 0). It calls the action hotspot_animate on hover, and hotspot_ranimate on out (reverse animate).
tour.xml:
Code
<action name="hotspot_animate">
inc(frame,1,get(lastframe),0);
mul(ypos,frame,frameheight);
txtadd(crop,'0|',get(ypos),'|',get(framewidth),'|',get(frameheight));
if(anistopped == false, delayedcall(0.03, hotspot_animate(%1) ););
if(frame == 6, stop(););
</action>
<action name="hotspot_ranimate">
trace("start ranimate");
set(hotspot[listen_pin].url, skin/listen_pin_ranimation.png);
start();
trace("stop ranimate");
</action>
<action name="start">
set(hotspot[listen_pin].anistopped, false); hotspot_animate(listen_pin);
trace("start");
</action>
<action name="stop">
set(hotspot[listen_pin].anistopped, true);
trace("stop");
</action>
Display More
vtourskin:
Code
<style name="listen_pin"
url="listen_pin_animation.png"
crop="0|0|120|120"
onover="start();"
onout="hotspot_ranimate();"
framewidth="120"
frameheight="120"
frame="0"
lastframe="9"
pauseframe="0"
onloaded=""
anistopped="true"
keep="false"
distorted="true"
/>
Display More
Any help would be greatly appreciated, thanks in advance!
Regards,
Sam