Sie sind nicht angemeldet.

1

Dienstag, 5. August 2014, 16:42

parallel tweens not overwrite?

Hello,

I have a series of hotspots, and I am adding in each of them (using onclick) some images that I want to animate:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<action name="click_action">

		inc(scoreInc, 1);
		txtadd(xxx,'pg_', get(scoreInc));
		addplugin(get(xxx));
		set(plugin[get(xxx)].url, skin/pct_f/30-puncte.png);
		set(plugin[get(xxx)].align, center);
		set(plugin[get(xxx)].alpha, 0);
		set(plugin[get(xxx)].enabled, false); 
		set(plugin[get(xxx)].parent, hotspot[%1]);
		animScore(plugin[get(xxx)]);
		set(hotspot[get(name)].isstopped, "true");
	<!-- 	hotspot[get(name)].loadstyle("hotspot_ani_white_static"); -->
		set(hotspot[get(name)].enabled, "false");
		incrementScore();
	</action>
	<action name="animScore">
		tween(%1.y, -50, 1);
		tween(%1.alpha, 1, .1);
		DelayedCall(1, tween(%1.alpha, 0, .3));
	</action>


My problem is that the tweens are overwriting.....so I click a hotspot>> animation inside starts ok>> click another>>the animation in previous is stopped and so on.

Is there a solution for this? a simply want to have animations in each hotspot completing on their own and don't have them stopped when I click on other hotspot.


Thank you,
W

2

Mittwoch, 6. August 2014, 06:46

Hi,

the problem is the get(...) inside the text that will be passed to the tween():
plugin[get(xxx)]

that get() will be resolved each time the tween will be updated.

(Btw - that will be changed in the next krpano version 1.18 - there all get() requests inside a tween variable will be resolved automatically before the start of the tween action)

A way to bypass this behavior would be to change the action code a bit and pass the resolved get() to the sub-action,
e.g.

Quellcode

1
animScore(get(xxx));
and:

Quellcode

1
2
3
4
5
<action name="animScore">
  tween(plugin[%1].y, -50, 1);
  tween(plugin[%1].alpha, 1, .1);
  DelayedCall(1, tween(plugin[%1].alpha, 0, .3));
</action>


Best regards,
Klaus

3

Mittwoch, 6. August 2014, 09:46

It works now. Thanks so much! *g*



Best regards,
W