You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Monday, December 3rd 2018, 10:47am

layer or hotspot animation

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

Source code

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

Source code

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

example

This post has been edited 2 times, last edit by "San7" (Dec 4th 2018, 7:10am)


2

Monday, December 3rd 2018, 10:30pm

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

This post has been edited 1 times, last edit by "pur" (Dec 9th 2018, 10:42pm)


3

Tuesday, December 4th 2018, 3:56am

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 has attached the following file:
  • tour.xml (1.72 kB - 21 times downloaded - latest: Jun 15th 2019, 8:32am)