Extends Animation

Animation.Parallel

A parallel animation is used to run several animations at the same time.

Parallel animations can contain any combination of other animation types. When used with sequential animations and tween animations, most common UI animation effects can be achieved.

Animation.Parallel {
    running: true
    loops: .Max
    Animation.Tween {
        target: parallelBall.x
        from: 0
        to: 300
        duration: 2000
    }
    Animation.Tween {
        target: parallelBall.opacity
        from: 1
        to: 0
        duration: 2000
    }
}

In the above example, the parallel animation contains two tween animations which run simultaneously. One animates the 'x' position of the rectangle and the other the rectangles opacity.

Animation.Parallel {
    running: true
        
    Animation.Tween {
        target: rect.rotation
        from: 0
        to: 360
        duration: 5000
    }
    
    Animation.Tween {
        target: rect.color
        to: Color.random()
        duration: 5000
    }
    
    Animation.Sequential {
        Animation.Tween {
            target: rect.width
            to: 1
            duration: 2500
        }
        
        Animation.Tween {
            target: rect.width
            to: 100
            duration: 2500
        }
    }
}

In the above example, there are three animations that run in parallel: two tween animations that animate the rotation and color properties; and one sequential animation that animates the width property.