@cccode/fxr - v22.0.0

    Class LinearProperty<T>

    Type Parameters

    Hierarchy (View Summary, Expand)

    Index

    Constructors

    Properties

    function: Linear
    keyframes: IBasicKeyframe<T>[] = []
    loop: boolean = false
    modifiers: IModifier<T>[]
    valueType: T

    Accessors

    • get componentCount(): 1 | 2 | 3 | 4

      Returns 1 | 2 | 3 | 4

    • get duration(): number

      Returns number

    • set duration(value: number): void

      Parameters

      • value: number

      Returns void

    • get fieldCount(): number

      Returns number

    Methods

    • Returns an equal property that works with the given game.

      If the property has multiple modifiers, there is a chance that the output of this method will not be perfectly equal, but it should still be close.

      Parameters

      • game: Game

        The game to ensure that the property works with.

      Returns Property<T, Linear>

    • Creates a new linear property that approximates a power function.

      Type Parameters

      Parameters

      • loop: boolean

        Controls whether the animation should loop or not.

      • exponent: number

        The exponent used in the power function. For example, setting this to values greater than 1 will make the property value change slowly at the start, but get faster and faster until it reaches the end.

      • keyframeCount: number

        How many keyframes to use for the approximation. Must be greater than or equal to 2. Using higher values will produce a smoother curve. Setting it to 2 will make it linear, which means you might as well use the basic method instead of this.

      • duration: number

        The duration of the animation.

      • startValue: TypeMap.PropertyValue[T]

        The value at the start of the animation.

      • endValue: TypeMap.PropertyValue[T]

        The value at the end of the animation.

      Returns LinearProperty<T>

    • Creates a new linear property that approximates a sine wave.

      Type Parameters

      Parameters

      • min: TypeMap.PropertyValue[T]

        The value used when the sine wave is at its minimum.

      • max: TypeMap.PropertyValue[T]

        The value used when the sine wave is at its maximum.

      • period: number

        The period of the sine wave.

      • phaseShift: number = 0

        The phase shift of the sine wave. 1 shifts it by one period.

      • stops: number = 21

        The number of stops to use to approximate the sine wave. Higher values result in a smoother curve. Defaults to 21.

      Returns LinearProperty<T>

    MMNEPVFCICPMFPCPTTAAATR