Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SourceText

Hierarchy

Index

Constructors

constructor

Properties

Readonly name

name: string = "Property name"

Readonly numKeys

numKeys: number = 0

The number of keyframes on the property

Readonly propertyIndex

propertyIndex: number = 0

The index number of the property in it's property group

Readonly speed

speed: string

A 1D, positive speed value equal to the speed at which the property is changing at the default time. This element can be used only for spatial properties.

style

style: TextStyle = ...

Readonly value

value: string

Readonly velocity

velocity: string

The temporal velocity value at the current time. For spatial properties, such as Position, it returns the tangent vector value. The result is the same dimension as the property.

Methods

createStyle

  • Used to create a new style object, rather than referencing and modifying an existing one.

    Returns TextStyle

    An empty style object

getStyleAt

  • getStyleAt(characterIndex: number, sampleTime?: number): TextStyle
  • Get the style object of a text property at a character index

    Parameters

    • characterIndex: number

      Which character to get the style at

    • sampleTime: number = 0

      The time to get the style at, defaulting to the current time

    Returns TextStyle

key

  • key(index: number): Key<string>
  • Parameters

    • index: number

      The index of the keyframe to return (e.g. the 1st keyframe)

    Returns Key<string>

    The keyframe at the specified index on the property

loopIn

  • loopIn(type?: loopType, numKeyframes?: number): string
  • Loops a segment of time that is measured from the first keyframe on the layer forward toward the Out point of the layer. The loop plays from the In point of the layer.

    Parameters

    • type: loopType = "cycle"

      "cycle": (default) Repeats the specified segment. "pingpong": Repeats the specified segment, alternating between forward and backward. "offset": Repeats the specified segment, but offsets each cycle by the difference in the value of the property at the start and end of the segment, multiplied by the number of times the segment has looped. "continue": Does not repeat the specified segment, but continues to animate a property based on the velocity at the first or last keyframe.

    • numKeyframes: number = 0

      determines what segment is looped: The segment looped is the portion of the layer from the first keyframe to the numKeyframes+1 keyframe. The default value of 0 means that all keyframes loop

    Returns string

loopInDuration

  • loopInDuration(type?: loopType, duration?: number): string
  • Loops a segment of time that is measured from the first keyframe on the layer forward toward the Out point of the layer. The loop plays from the In point of the layer.

    Parameters

    • type: loopType = "cycle"

      "cycle": (default) Repeats the specified segment. "pingpong": Repeats the specified segment, alternating between forward and backward. "offset": Repeats the specified segment, but offsets each cycle by the difference in the value of the property at the start and end of the segment, multiplied by the number of times the segment has looped. "continue": Does not repeat the specified segment, but continues to animate a property based on the velocity at the first or last keyframe.

    • duration: number = 0

      The number of composition seconds in a segment to loop; the specified range is measured from the first keyframe

    Returns string

loopOut

  • loopOut(type?: loopType, numKeyframes?: number): string
  • Loops a segment of time that is measured from the last keyframe on the layer back toward the In point of the layer. The loop plays until the Out point of the layer.

    Parameters

    • type: loopType = "cycle"

      "cycle": (default) Repeats the specified segment. "pingpong": Repeats the specified segment, alternating between forward and backward. "offset": Repeats the specified segment, but offsets each cycle by the difference in the value of the property at the start and end of the segment, multiplied by the number of times the segment has looped. "continue": Does not repeat the specified segment, but continues to animate a property based on the velocity at the first or last keyframe.

    • numKeyframes: number = 0

      determines what segment is looped: The segment looped is the portion of the layer from the last keyframe to the thisProperty.numKeys - numKeyframes keyframe. The default value of 0 means that all keyframes loop

    Returns string

loopOutDuration

  • loopOutDuration(type?: loopType, duration?: number): string
  • Loops a segment of time that is measured from the last keyframe on the layer back toward the In point of the layer. The loop plays until the Out point of the layer.

    Parameters

    • type: loopType = "cycle"

      "cycle": (default) Repeats the specified segment. "pingpong": Repeats the specified segment, alternating between forward and backward. "offset": Repeats the specified segment, but offsets each cycle by the difference in the value of the property at the start and end of the segment, multiplied by the number of times the segment has looped. "continue": Does not repeat the specified segment, but continues to animate a property based on the velocity at the first or last keyframe.

    • duration: number = 0

      The number of composition seconds in a segment to loop; the specified range is measured from the last keyframe backwards.

    Returns string

nearestKey

  • nearestKey(time: number): Key<string>
  • Parameters

    • time: number

    Returns Key<string>

    The marker that is nearest in time to t

propertyGroup

  • Parameters

    • countUp: number

      The number of levels in the property hierarchy to ascend, e.g. countUp = 1 will return the parent PropertyGroup.

    Returns PropertyGroup

    The group of properties (PropertyGroup object) relative to the property of which the expression is written

smooth

  • smooth(width?: number, samples?: number, time?: number): string
  • Smooths the property values over time, converting large, brief deviations in the value to smaller, more evenly distributed deviations. This smoothing is accomplished by applying a box filter to the value of the property at the specified time.

    Parameters

    • width: number = 0.2

      The range of time (in seconds) over which the filter is averaged.

    • samples: number = 5

      The number of discrete samples evenly spaced over time; use a larger value for greater smoothness (but decreased performance). Generally, you’ll want samples to be an odd number so that the value at the current time is included in the average.

    • time: number = 0

    Returns string

speedAtTime

  • speedAtTime(time: number): string
  • Parameters

    • time: number

      The composition time in seconds to get the speed at

    Returns string

    A 1D, positive speed value equal to the speed at which the property is changing at the specified time. This element can be used only for spatial properties.

temporalWiggle

  • temporalWiggle(freq: number, amp: number, octaves?: number, amp_mult?: number, time?: number): string
  • Samples the property value at a time which is wiggled

    Parameters

    • freq: number

      The rate at which the value changes in wiggles per second

    • amp: number

      How much the value should change, in units of the original property value (e.g. 1 by 100% of the original value)

    • octaves: number = 1

      How much detail the wiggle has, which is driven by the number of "octaves" of noise to multiply together. Higher values will have more detail

    • amp_mult: number = 0.5

      The amount the given amplitude is multiplied by for each octave, which controls the falloff of the upper harmonics ("octaves").

    • time: number = 0

      The time at which the value is sampled for use within the wiggle

    Returns string

valueAtTime

  • valueAtTime(time: number): string
  • Returns the value for the property at the specified time

    Parameters

    • time: number

      THe composition time in seconds to get the value at

    Returns string

velocityAtTime

  • velocityAtTime(time: number): string
  • Parameters

    • time: number

      The composition time in seconds to get the velocity at

    Returns string

    The temporal velocity value at the specified time. For spatial properties, such as Position, it returns the tangent vector value. The result is the same dimension as the property.

wiggle

  • wiggle(freq: number, amp: number, octaves?: number, amp_mult?: number, time?: number): string
  • Modifies the property value randomly over time.

    Parameters

    • freq: number

      The rate at which the value changes in wiggles per second

    • amp: number

      How much the value should change, in units of the original property value (e.g. 1 by 100% of the original value)

    • octaves: number = 1

      How much detail the wiggle has, which is driven by the number of "octaves" of noise to multiply together. Higher values will have more detail

    • amp_mult: number = 0.5

      The amount the given amplitude is multiplied by for each octave, which controls the falloff of the upper harmonics ("octaves").

    • time: number = 0

      The time at which the value is sampled for use within the wiggle

    Returns string

Generated using TypeDoc