layer.animate(options)
Start animating this layer. The animation options describe the properties it needs to animate to and how to animate. Running this method will create a new Animation Object with the animationOptions, which you can use to stop or reverse the animation. Here, the duration of the animation is 5 seconds.
译:启动动画这一层。动画选项形容它需要动画并如何动画的属性。运行此方法将创建一个新的Animation Object 的animationOptions,你可以用它来停止或逆转动画。这里,动画的持续时间为5秒。
layerA = new Layer
# Animate scale and rotation
layerA.animate
properties:
scale: 0.5
rotation: 90
time: 5
In the example below, there is a 2 second delay between every repeat.
译:在下面的例子中,有每个重复之间一个2秒的延迟。
# Repeat and delay the animation
layerA.animate
properties:
x: 100
repeat: 5
delay: 2