LinearAnimationInstance

class LinearAnimationInstance(unsafeCppPointer: Long, lock: ReentrantLock, var mix: Float = 1.0f) : PlayableInstance, NativeObject

The LinearAnimationInstance is a helper to wrap common operations to play an animation.

Use this to keep track of an animation's current state and progress. You may also apply changes that the animation makes to components in an Artboard.

Parameters

unsafeCppPointer

Pointer to the C++ counterpart.

Constructors

Link copied to clipboard
constructor(unsafeCppPointer: Long, lock: ReentrantLock, mix: Float = 1.0f)

Properties

Link copied to clipboard

Getter/Setter for the underlying C++ pointer value.

Link copied to clipboard
Link copied to clipboard

Configure the animation to play forwards or backwards.

Link copied to clipboard

The duration of an animation in frames. This does not take workStart and workEnd into account.

Link copied to clipboard

The duration of this animation in frames, taking workStart and workEnd into account.

Link copied to clipboard

The duration of an animation in seconds, taking workStart and workEnd into account.

Link copied to clipboard

The offset in seconds to the end of the animation.

Link copied to clipboard
val fps: Int

Return the frames per second (FPS) configured for this animation.

Link copied to clipboard

Whether this objects underlying pointer is still valid.

Link copied to clipboard
var loop: Loop

Configure the Loop mode for this animation. Can be either Loop.LOOP, Loop.ONESHOT, Loop.PINGPONG or Loop.AUTO.

Link copied to clipboard
var mix: Float
Link copied to clipboard
open override val name: String

The name given to this animation.

Link copied to clipboard
open val refCount: Int
Link copied to clipboard
override var refs: AtomicInteger
Link copied to clipboard

The offset in seconds to the beginning of the animation. Animations will start playing from here.

Link copied to clipboard
val time: Float

The elapsed time that this instance has played to.

Link copied to clipboard

The offset in frames to the end of an animations work area. Animations will execute their loop behavior once this is reached.

Link copied to clipboard

The offset in frames to the beginning of an animations work area. Animations will start playing from here.

Functions

Link copied to clipboard
open override fun acquire(): Int

Increments the references for this counter. Cannot be used for initialization - use refs.incrementAndGet instead.

Link copied to clipboard
fun advance(elapsedTime: Float): Loop?

Advance the animation.

Link copied to clipboard

Advance the animation and return the result.

Link copied to clipboard
fun apply()

Applies the animation instance's current set of transformations to an Artboard.

fun apply(elapsed: Float): Boolean

Applies and advances the animation instance in a single step.

Link copied to clipboard
open external override fun cppDelete(pointer: Long)
Link copied to clipboard
open override fun release(): Int

Decrements the reference counter.

Link copied to clipboard
fun time(time: Float)

Seeks the animation to time.