Attract-Mode Support Forum
Attract-Mode Support => Scripting => Topic started by: Mayki07 on October 04, 2018, 12:13:38 PM
-
How to activate another animation when the previous animations are finished?
First animation :
local move2_cfg = {
when = Transition.StartLayout,
property = "x",
start = 2000,
end = 785,
time = 3000
delay = 1000
}
Second animation :
local move4_cfg = {
when = Transition.ToNewSelection,
wait = true,
property = "x",
start = 805,
end = 785,
time = 40
delay = 40
tween = Tween.Expo
pulse = true
}
-
Hi Mayki07,
in this way
local secondAnimationConfig = {
property = ...,
start = ...,
end = ...,
time = ...,
tween = ...,
...
}
local firstAnimationConfig = {
when = When.StartLayout,
property = ...,
start = ...,
end = ...,
time = ...,
tween = ...,
...
onStop = function( anim ) {
animation.add( PropertyAnimation ( targetObject02, secondAnimationConfig ) );
}
}
animation.add( PropertyAnimation ( targetObject01, firstAnimationConfig ) );
Note: second animation is configured without "when" attribute