Animation Curves

  1. linear — 匀速运动
  2. bezier-curve — 贝塞尔曲线
  3. spring-— 龙格库塔弹性曲线.
  4. spring— 阻尼谐振弹性曲线.
  5. 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:
译:该弹性曲线包含的属性参数:

  1. tension — 弹性张力.
  2. friction — 弹性重力.
  3. velocity — 初始速度.
  4. 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:
译:该弹性曲线包含的属性参数:

  1. stiffness — 弹性张力
  2. damping — 弹性变化减速度大小
  3. mass — 物体的重量
  4. 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()

results matching ""

    No results matching ""