Sie sind nicht angemeldet.

1

Donnerstag, 17. Januar 2013, 06:45

Hotspot animation

Hi,

I would like to make hotspot blinking. So I think the tweening of the alpha setting of the hotspot will help.
Followings are my code. However, the hotspt doesnot blinking, but just disappeared.

Please check for me.

Quellcode

1
2
3
4
5
6
<hotspot name="info1" url="http://360vr.kr/panoramas/NMus/skin/map_node_s.png" ath="0" atv="3" onloaded="wait(3); hotspot_animate(get(name));" />

<action name="hotspot_animate">
	tween(hotspot[%1].alpha, 0.0, 1, default, tween(hotspot[%1].alpha, 1.0, 1));
	if(loaded, delayedcall(0.01, hotspot_animate(%1); ); ); 
</action>


Thanks in advance.

Min

2

Donnerstag, 17. Januar 2013, 10:29

Hi,

it is disappearing because you restart the tween to 0 every 0.01 seconds (the delayedcall).

Here a working code with an endless loop - see the donecall in the second tween:

Quellcode

1
2
3
4
5
<action name="hotspot_animate">
  if(hotspot[%1].loaded,
    tween(hotspot[%1].alpha, 0.0, 1.0, default, tween(hotspot[%1].alpha, 1.0, 1.0, default, hotspot_animate(%1) ) );
  );
</action>


First it will tween alpha 0.0, then the second tween will be called where alpha will be tweened to 1.0, and when this is done too - the action itself will be called again and the process starts from the beginning.

And as 'stop action' there is the 'loaded' check around to avoid running that action endless even if the hotspot is already removed.

Best regards,
Klaus

3

Donnerstag, 17. Januar 2013, 13:16

Thanks klaus!

It works just as if I wanted. Great!!

4

Mittwoch, 2. Oktober 2013, 03:56

was getting "action overflows" with my code

this works GREAT *smile*

thanx Klaus!