Author Topic: Animation question  (Read 565 times)

Mayki07

  • Full Member
  • ***
  • Posts: 31
    • View Profile
Animation question
« on: October 04, 2018, 12:13:38 PM »
How to activate another animation when the previous animations are finished?

First animation :
Code: [Select]
local move2_cfg = {
    when = Transition.StartLayout,
    property = "x",
    start = 2000,
    end = 785,
    time = 3000
    delay = 1000
}

Second animation :
Code: [Select]
local move4_cfg = {
    when = Transition.ToNewSelection,
    wait = true,
    property = "x",
    start = 805,
    end = 785,
    time = 40
    delay = 40
    tween = Tween.Expo
    pulse = true
}

alucard

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Re: Animation question
« Reply #1 on: December 30, 2018, 01:47:50 AM »
Hi Mayki07,

in this way

Code: [Select]
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