Sie sind nicht angemeldet.

1

Montag, 3. Dezember 2018, 10:47

layer or hotspot animation

Hello,
I want to share the code for the animation.
Create a vibrational motion of a layer or hotspot.

Quellcode

1
2
3
4
5
6
7
8
9
10
<action name="wobble" scope="local" args="attribute, min, max, time">
	set(local.vverh, false);
	calc(cal,'caller.' + attribute);
	setinterval(calc('merc_' + caller.name), get(time), 
			if(vverh,tween(get(cal),get(max),get(time)); set(vverh,false);
				,
				tween(get(cal),get(min),get(time)); set(vverh,true);
			);
		);
</action>

start the action, for example, changing the scale from 0.5 to 1 in 1 second

Quellcode

1
onloaded="wobble(scale,0.5,1,1);"

example

Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »San7« (4. Dezember 2018, 07:10)


2

Montag, 3. Dezember 2018, 22:30

San,

Thank you for sharing your example. It's really "code with taste" . I highly appreciate it.
(I'm not grasping the subject of the post.)

Pavel

P.S.
San, thanks for giving a reference. I also like the tweens types where the values go out of limits (e.g. easeOutElastic). Interesting. I haven't realized it...
Thanks,
Pavel

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »pur« (9. Dezember 2018, 22:42)


3

Dienstag, 4. Dezember 2018, 03:56

Probably this topic is suitable *smile*
I based on the Klaus code from example and changed a bit.

If you use different types of transitions for tween , you can achieve interesting results.

I made a change and the ball jumps more realistic)
can see the file from the example
»San7« hat folgende Datei angehängt:
  • tour.xml (1,72 kB - 8 mal heruntergeladen - zuletzt: 11. Dezember 2018, 13:06)