Lens Scripting API

    Class AnimationCurve

    A curve that contains a set of keyframes and can evaluate values at specific timestamps.

    // Example of using Animation Curve

    // creating keyframes
    var A = AnimationCurve.createKeyFrame();
    var B = AnimationCurve.createKeyFrame();

    // creating AnimationCurve
    var curve = AnimationCurve.create();
    A.time = 0.0;
    A.value = 0.0;

    B.time = 1.0;
    B.value = 1.0;

    curve.addKeyframe(A);
    curve.addKeyframe(B);
    let idxB = curve.addKeyframe(B);

    // evaluating value
    var value = curve.evaluate(0.5);

    Hierarchy (View Summary, Expand)

    Index

    Constructors

    Properties

    keyFrameCount: number

    The number of keyframes in the animation curve.

    Methods

    • Creates curve based on CSS easing values.

      Parameters

      • startValue: number
      • endValue: number
      • x1: number
      • y1: number
      • x2: number
      • y2: number

      Returns AnimationCurve

    • Evaluate value of the curve at specific point.

      Parameters

      • time: number

      Returns number

    • Returns true if the object matches or derives from the passed in type.

      Parameters

      • type: string

      Returns boolean

    • Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

      Parameters

      Returns boolean

    • Remove animation keyframe at specific timestamp. The closest keyframe will be deleted.

      Parameters

      • t: number

      Returns void

    MMNEPVFCICPMFPCPTTAAATR