The base class for timelines that interpolate between frame values using stepped, linear, or a Bezier curve.

Static variables

@:value(0)staticinlineread onlyLINEAR:Int = 0

@:value(1)staticinlineread onlySTEPPED:Int = 1

@:value(2)staticinlineread onlyBEZIER:Int = 2

@:value(18)staticinlineread onlyBEZIER_SIZE:Int = 18

Constructor

new(frameCount:Int, bezierCount:Int, propertyIds:StringArray)

@link #shrink(int)}.

Parameters:

bezierCount

The maximum number of Bezier curves. See {

propertyIds

Unique identifiers for the properties the timeline modifies.

Variables

Methods

setLinear(frame:Int):Void

Sets the specified frame to linear interpolation.

Parameters:

frame

Between 0 and frameCount - 1, inclusive.

setStepped(frame:Int):Void

Sets the specified frame to stepped interpolation.

Parameters:

frame

Between 0 and frameCount - 1, inclusive.

getCurveType(frame:Int):Int

Returns the interpolation type for the specified frame. @link #LINEAR}, {@link #STEPPED}, or {@link #BEZIER} + the index of the Bezier segments.

Parameters:

frame

Between 0 and frameCount - 1, inclusive.

Returns:

{

shrink(bezierCount:Int):Void

Shrinks the storage for Bezier curves, for use when bezierCount (specified in the constructor) was larger than the actual number of Bezier curves.

setBezier(bezier:Int, frame:Int, value:Int, time1:Float, value1:Float, cx1:Float, cy1:Float, cx2:Float, cy2:Float, time2:Float, value2:Float):Void

Stores the segments for the specified Bezier curve. For timelines that modify multiple values, there may be more than one curve per frame.

Parameters:

bezier

The ordinal of this Bezier curve for this timeline, between 0 and bezierCount - 1 (specified in the constructor), inclusive.

frame

Between 0 and frameCount - 1, inclusive.

value

The index of the value for the frame this curve is used for.

time1

The time for the first key.

value1

The value for the first key.

cx1

The time for the first Bezier handle.

cy1

The value for the first Bezier handle.

cx2

The time of the second Bezier handle.

cy2

The value for the second Bezier handle.

time2

The time for the second key.

value2

The value for the second key.

getBezierValue(time:Float, frameIndex:Int, valueOffset:Int, i:Int):Float

Returns the Bezier interpolated value for the specified time. @link #getFrames()} for the values of the frame before time. @link #getCurveType(int)}.

Parameters:

frameIndex

The index into {

valueOffset

The offset from frameIndex to the value this curve is used for.

i

The index of the Bezier segments. See {

Inherited Variables

Inherited Methods

Defined by Timeline

getPropertyIds():StringArray

Uniquely encodes both the type of this timeline and the skeleton properties that it affects.

getFrames():FloatArray

The time in seconds and any other values for each frame.

getFrameEntries():Int

The number of entries stored per frame.

getFrameCount():Int

The number of frames for this timeline.

apply(skeleton:Skeleton, lastTime:Float, time:Float, events:Array<Event>, alpha:Float, blend:MixBlend, direction:MixDirection):Void

Applies this timeline to the skeleton. @link EventTimeline} trigger only

      at specific times rather than every frame. In that case, the timeline triggers everything between
      <code>lastTime</code> (exclusive) and <code>time</code> (inclusive). Pass -1 the first time an animation is
      applied to ensure frame 0 is triggered.

@link DrawOrderTimeline} or {@link AttachmentTimeline}, and others such as {@link ScaleTimeline}.

Parameters:

skeleton

The skeleton to which the timeline is being applied. This provides access to the bones, slots, and other skeleton components that the timeline may change.

lastTime

The last time in seconds this timeline was applied. Timelines such as {

time

The time in seconds that the skeleton is being posed for. Most timelines find the frame before and the frame after this time and interpolate between the frame values. If beyond the last frame, the last frame will be applied.

events

If any events are fired, they are added to this list. Can be null to ignore fired events or if the timeline does not fire events.

alpha

0 applies the current or setup value (depending on blend). 1 applies the timeline value. Between 0 and 1 applies a value between the current or setup value and the timeline value. By adjusting alpha over time, an animation can be mixed in or out. alpha can also be useful to apply animations on top of each other (layering).

blend

Controls how mixing is applied when alpha < 1.

direction

Indicates whether the timeline is mixing in or out. Used by timelines which perform instant transitions, such as {