Author Topic: Animations  (Read 92 times)

Yaron2019

  • Full Member
  • ***
  • Posts: 96
    • View Profile
Animations
« on: March 22, 2020, 03:40:36 AM »
Hi,
How can I delay a start of one animation until another one is finished?

For example, in this code I have an animation that runs when the layout starts (Transition.StartLayout) and I want the next animation that should run when navigating the wheel Transition.ToNewSelection to NOT run until the StratLayout is complete.


if ( my_config["enable_gboxart"] == "Yes" )
{
   local y = 0.45;
   
   if ( my_config["enable_frame"] == "No" )
      y = 0.47;
      
   local boxart = fe.add_artwork("boxart", flx*0.38, fly*y flw*0.2, flh*0.6 );

   boxart.preserve_aspect_ratio = true;

   local start_transition1 = {
      when = Transition.StartLayout,
      property = "y",
      start = fly*2,
      end = fly*y,
      time = (ini_anim_time+400)
   }
   animation.add( PropertyAnimation( boxart, start_transition1 ) );
   
        // ADD CODE -  DON'T RUN THE NEXT ANIM UNTIL THE FIRST ONE IS FINSIHED
   local move_transition1 = {
      when = Transition.ToNewSelection,
      property = "y",
      start = fly*2,
      end = fly*y,
      time = 1200
   }
   animation.add( PropertyAnimation( boxart, move_transition1 ) );
}

Thnx

qqplayer

  • Sr. Member
  • ****
  • Posts: 289
    • View Profile
Re: Animations
« Reply #1 on: March 22, 2020, 01:15:34 PM »
Maybe this will work "wait = true,"
Im not sure because you are triggering the second animation with  "when = Transition.ToNewSelection,"



Code: [Select]
   local start_transition1 = {
      when = Transition.StartLayout,
      property = "y",
      start = fly*2,
      end = fly*y,
      time = (ini_anim_time+400)
      wait = true,
   }
   animation.add( PropertyAnimation( boxart, start_transition1 ) );

« Last Edit: March 22, 2020, 01:18:51 PM by qqplayer »