-
- All Implemented Interfaces:
-
app.rive.runtime.kotlin.core.PlayableInstance,app.rive.runtime.kotlin.core.RefCount
public final class LinearAnimationInstance extends NativeObject implements PlayableInstance
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.
-
-
Field Summary
Fields Modifier and Type Field Description private final Floattimeprivate Directiondirectionprivate final Integerdurationprivate final IntegereffectiveDurationprivate final FloateffectiveDurationInSecondsprivate final Integerfpsprivate final IntegerworkStartprivate final IntegerworkEndprivate final Stringnameprivate final FloatstartTimeprivate final FloatendTimeprivate Looploopprivate Floatmixprivate final BooleanhasCppObjectprivate AtomicIntegerrefsprivate LongcppPointerprivate final List<RefCount>dependenciesprivate final IntegerrefCount
-
Constructor Summary
Constructors Constructor Description LinearAnimationInstance(Long unsafeCppPointer, ReentrantLock lock, Float mix)
-
Method Summary
Modifier and Type Method Description final FloatgetTime()final DirectiongetDirection()final UnitsetDirection(Direction direction)final IntegergetDuration()final IntegergetEffectiveDuration()final FloatgetEffectiveDurationInSeconds()final IntegergetFps()final IntegergetWorkStart()final IntegergetWorkEnd()StringgetName()final FloatgetStartTime()final FloatgetEndTime()final LoopgetLoop()final UnitsetLoop(Loop loop)final FloatgetMix()final UnitsetMix(Float mix)final BooleangetHasCppObject()final AtomicIntegergetRefs()final UnitsetRefs(AtomicInteger refs)final LonggetCppPointer()final UnitsetCppPointer(Long cppPointer)final List<RefCount>getDependencies()IntegergetRefCount()UnitcppDelete(Long pointer)final Loopadvance(Float elapsedTime)Advance the animation. final AdvanceResultadvanceAndGetResult(Float elapsedTime)Advance the animation and return the result. final Unitapply()Applies the animation instance's current set of transformations to an Artboard. final Booleanapply(Float elapsed)Applies and advances the animation instance in a single step. final Unittime(Float time)Seeks the animation to time. -
-
Constructor Detail
-
LinearAnimationInstance
LinearAnimationInstance(Long unsafeCppPointer, ReentrantLock lock, Float mix)
- Parameters:
unsafeCppPointer- Pointer to the C++ counterpart.
-
-
Method Detail
-
getDirection
final Direction getDirection()
-
setDirection
final Unit setDirection(Direction direction)
-
getDuration
final Integer getDuration()
-
getEffectiveDuration
final Integer getEffectiveDuration()
-
getEffectiveDurationInSeconds
final Float getEffectiveDurationInSeconds()
-
getWorkStart
final Integer getWorkStart()
-
getWorkEnd
final Integer getWorkEnd()
-
getStartTime
final Float getStartTime()
-
getEndTime
final Float getEndTime()
-
getHasCppObject
final Boolean getHasCppObject()
-
getRefs
final AtomicInteger getRefs()
-
setRefs
final Unit setRefs(AtomicInteger refs)
-
getCppPointer
final Long getCppPointer()
-
setCppPointer
final Unit setCppPointer(Long cppPointer)
-
getDependencies
final List<RefCount> getDependencies()
-
getRefCount
Integer getRefCount()
-
advance
@Deprecated(message = Use advanceAndGetResult instead., replaceWith = @ReplaceWith(imports = {}, expression = advanceAndGetResult(elapsedTime))) final Loop advance(Float elapsedTime)
Advance the animation.
- Parameters:
elapsedTime- The time in seconds to advance by.
-
advanceAndGetResult
final AdvanceResult advanceAndGetResult(Float elapsedTime)
Advance the animation and return the result.
- Parameters:
elapsedTime- The time in seconds to advance by.
-
apply
final Boolean apply(Float elapsed)
Applies and advances the animation instance in a single step.
-
-
-
-