-
- All Implemented Interfaces:
-
app.rive.runtime.kotlin.core.RefCount
@OpenForTesting() public final class Artboard extends NativeObject
-
-
Field Summary
Fields Modifier and Type Field Description private final Stringnameprivate final LinearAnimationInstancefirstAnimationprivate final StateMachineInstancefirstStateMachineprivate Floatvolumeprivate final IntegeranimationCountprivate final IntegerstateMachineCountprivate ViewModelInstanceviewModelInstanceprivate final RectFboundsprivate Floatwidthprivate Floatheightprivate final List<String>animationNamesprivate final List<String>stateMachineNamesprivate final BooleanhasCppObjectprivate AtomicIntegerrefsprivate LongcppPointerprivate final <ERROR CLASS>dependenciesprivate final IntegerrefCount
-
Constructor Summary
Constructors Constructor Description Artboard(Long unsafeCppPointer, ReentrantLock lock)
-
Method Summary
Modifier and Type Method Description final StringgetName()final LinearAnimationInstancegetFirstAnimation()final StateMachineInstancegetFirstStateMachine()final FloatgetVolume()final UnitsetVolume(Float volume)final IntegergetAnimationCount()final IntegergetStateMachineCount()final ViewModelInstancegetViewModelInstance()The ViewModelInstance assigned to this artboard. final UnitsetViewModelInstance(ViewModelInstance viewModelInstance)final RectFgetBounds()final FloatgetWidth()final UnitsetWidth(Float width)final FloatgetHeight()final UnitsetHeight(Float height)final List<String>getAnimationNames()final List<String>getStateMachineNames()final BooleangetHasCppObject()final AtomicIntegergetRefs()final UnitsetRefs(AtomicInteger refs)final LonggetCppPointer()final UnitsetCppPointer(Long cppPointer)final <ERROR CLASS>getDependencies()IntegergetRefCount()UnitcppDelete(Long pointer)final LinearAnimationInstanceanimation(Integer index)Get the animation at a given index in the Artboard. final LinearAnimationInstanceanimation(String name)Get the animation with a given name in the Artboard. final StateMachineInstancestateMachine(Integer index)Get the animation at a given index in the artboard. final StateMachineInstancestateMachine(String name)Get the animation with a given name in the artboard. final SMIInputinput(String name, String path)Get the input instance with a given name on the nested artboard represented at path. final RiveTextValueRuntextRun(String name)Get a RiveTextValueRun with a given name in the artboard. final RiveTextValueRuntextRun(String name, String path)Get a RiveTextValueRun with a given name on the nested artboard represented at path. final StringgetTextRunValue(String name)Get the text value for a text run named name. final StringgetTextRunValue(String name, String path)Get the text value for a text run named name on the nested artboard represented at path. final UnitsetTextRunValue(String name, String textValue)Set the text value for a text run named name to textValue. final UnitsetTextRunValue(String name, String textValue, String path)Set the text value for a text run named name to textValue on the nested artboard represented at path. final ViewModelInstancereceiveViewModelInstance(ViewModelInstance.Transfer transfer)final Booleanadvance(Float elapsedTime)Advancing the artboard: Updates the layout for all dirty components contained in the artboard
Updates the positions
Forces all components in the artboard to be laid out
final <ERROR CLASS>draw(Long rendererAddress)Draw the the artboard to the renderer. final Unitdraw(Long rendererAddress, Fit fit, Alignment alignment, Float scaleFactor)Draw the the artboard to the renderer. final UnitresetArtboardSize()Reset the artboard size to its defaults. -
-
Constructor Detail
-
Artboard
Artboard(Long unsafeCppPointer, ReentrantLock lock)
- Parameters:
unsafeCppPointer- Pointer to the C++ counterpart.
-
-
Method Detail
-
getFirstAnimation
final LinearAnimationInstance getFirstAnimation()
-
getFirstStateMachine
final StateMachineInstance getFirstStateMachine()
-
getAnimationCount
final Integer getAnimationCount()
-
getStateMachineCount
final Integer getStateMachineCount()
-
getViewModelInstance
final ViewModelInstance getViewModelInstance()
The ViewModelInstance assigned to this artboard. Once assigned, modifications to the properties of the instance will be reflected in the bindings of this artboard.
Assigning null will do nothing.
You should only use assign this property if your file does not contain a state machine. If it does, prefer StateMachineInstance.viewModelInstance instead, as it will set the view model for both the state machine and the artboard.
-
setViewModelInstance
final Unit setViewModelInstance(ViewModelInstance viewModelInstance)
-
getAnimationNames
final List<String> getAnimationNames()
-
getStateMachineNames
final List<String> getStateMachineNames()
-
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 <ERROR CLASS> getDependencies()
-
getRefCount
Integer getRefCount()
-
animation
final LinearAnimationInstance animation(Integer index)
-
animation
final LinearAnimationInstance animation(String name)
-
stateMachine
final StateMachineInstance stateMachine(Integer index)
Get the animation at a given index in the artboard.
This starts at 0.
-
stateMachine
final StateMachineInstance stateMachine(String name)
Get the animation with a given name in the artboard.
-
textRun
final RiveTextValueRun textRun(String name)
Get a RiveTextValueRun with a given name in the artboard.
-
textRun
final RiveTextValueRun textRun(String name, String path)
Get a RiveTextValueRun with a given name on the nested artboard represented at path.
-
getTextRunValue
final String getTextRunValue(String name)
Get the text value for a text run named name.
-
getTextRunValue
final String getTextRunValue(String name, String path)
-
setTextRunValue
final Unit setTextRunValue(String name, String textValue)
-
setTextRunValue
final Unit setTextRunValue(String name, String textValue, String path)
-
receiveViewModelInstance
final ViewModelInstance receiveViewModelInstance(ViewModelInstance.Transfer transfer)
-
advance
final Boolean advance(Float elapsedTime)
Advancing the artboard:
Updates the layout for all dirty components contained in the artboard
Updates the positions
Forces all components in the artboard to be laid out
Components are all the shapes, bones and groups of an artboard. Whenever components are added to an artboard, for example when an artboard is first loaded, they are considered dirty. Whenever animations change properties of components, move a shape, or change a color, they are marked as dirty.
Before any changes to components will be visible in the next rendered frame, the artboard needs to be advanced.
elapsedTime is currently not taken into account.
-
draw
@WorkerThread() final <ERROR CLASS> draw(Long rendererAddress)
Draw the the artboard to the renderer.
-
draw
@WorkerThread() final Unit draw(Long rendererAddress, Fit fit, Alignment alignment, Float scaleFactor)
Draw the the artboard to the renderer. Also align the artboard to the render surface.
-
resetArtboardSize
final Unit resetArtboardSize()
Reset the artboard size to its defaults.
-
-
-