A track meant to be updated by a timeline. Base implementation doesn't do much by itself. Create subclasses to implement details

Constructor

new()

Variables

@:value(0)size:Int = 0

Track size. Default 0, meaning this track won't do anything. By default, because autoFitSize is true, adding new keyframes to this track will update size accordingly so it may not be needed to update size explicitly. Setting size to -1 means the track will never finish.

@:value(true)autoFitSize:Bool = true

If set to true (default), adding keyframes to this track will update its size accordingly to match last keyframe time.

@:value(false)loop:Bool = false

Whether this track should loop. Ignored if track's size is -1 (not defined).

@:value(false)locked:Bool = false

Whether this track is locked or not. A locked track doesn't get updated by the timeline it is attached to, if any.

@:value(null)@:allow(ceramic.Timeline)read onlytimeline:Timeline = null

Timeline on which this track is added to

@:value(0)read onlyposition:Float = 0

Position on this track. Gets back to zero when loop=true and position reaches a defined size.

@:value([])read onlykeyframes:ReadOnlyArray<K> = []

The key frames on this track.

@:value(null)read onlybefore:K = null

The keyframe right before or equal to current time, if any.

@:value(null)read onlyafter:K = null

The keyframe right after current time, if any.

Methods

finalseek(targetPosition:Float):Void

Seek the given position (in frames) in the track. Will take care of clamping position or looping it depending on size and loop properties.

add(keyframe:K):Void

Add a keyframe to this track

remove(keyframe:K):Void

Remove a keyframe from this track

fitSize():Void

Update size property to make it fit the index of the last keyframe on this track.

@:value({ forceChange : false })apply(forceChange:Bool = false):Void

Apply changes that this track is responsible of. Usually called after update(delta) or seek(time).

findKeyframeBefore(position:Float):Null<K>

Find the keyframe right before or equal to given position

findKeyframeAfter(position:Float):Null<K>

Find the keyframe right after given position

Inherited Events

Defined by Entity

@:dox(show)dispose(entity:Entity):Void

@:dox(show)destroy(entity:Entity):Void

Inherited Variables

Defined by Entity

read onlyhasData:Bool

@:value(null)id:String = null

read onlydestroyed:Bool

read onlydisposed:Bool

@:value(null)read onlyautoruns:Array<Autorun> = null

@editablecomponents:ReadOnlyMap<String, Component>

Public components mapping. Contain components created separately with component() or macro-based components as well.

scriptContent:ScriptContent

Available with script plugin

script:Script

Available with script plugin

Inherited Methods

Defined by Entity

dispose():Void

Schedules destroy, at the end of the current frame.

unbindEvents():Void

Remove all events handlers from this entity.

autorun(run:() ‑> Void, ?afterRun:() ‑> Void):Autorun

Creates a new Autorun instance with the given callback associated with the current entity.

Parameters:

run

The run callback

Returns:

The autorun instance

tween(?easing:Easing, duration:Float, fromValue:Float, toValue:Float, update:(Float, Float) ‑> Void):Tween

component<C>(?name:String, ?component:Null<C>):C