Animation Curves
linear— 匀速运动bezier-curve— 贝塞尔曲线spring-— 龙格库塔弹性曲线.spring— 阻尼谐振弹性曲线.spring— "spring-rk4"的别名
Example: bezier curve(示例: bezier-curve)
layerA = new Layer
# Animate with a bezier curve
animationA = new Animation
layer: layerA
properties:
x: 100
opacity: 0.5
curve: "bezier-curve(0.25, 0.1, 0.25, 1)"
Example: spring-rk4(示例: spring-rk4)
The included spring curve values are:
译:该弹性曲线包含的属性参数:
tension— 弹性张力.friction— 弹性重力.velocity— 初始速度.tolerance— 动画结束前的最小值. (可选)
See this interactive curve slider learn more.
译:点击弹性曲线调节器可以感受体验一下。
layerA = new Layer
# Animate with the spring-rk4 curve
animationA = new Animation
layer: layerA
properties:
x: 100
curve: "spring(400, 30, 0)"
Example: spring-dho(示例: spring-dho)
The included spring curve values are:
译:该弹性曲线包含的属性参数:
stiffness— 弹性张力damping— 弹性变化减速度大小mass— 物体的重量tolerance— 动画结束前的最小值(可选)
layerA = new Layer
# Animate with the spring-dho curve
animationA = new Animation
layer: layerA
properties:
x: 100
curve: "spring-dho(800, 200, 10, 0.01)"
animationA.start()