-
public final class RiveUIKt
-
-
Field Summary
Fields Modifier and Type Field Description public final static StringGENERAL_TAGpublic final static StringSTATE_MACHINE_TAGpublic final static StringVM_INSTANCE_TAGpublic final static StringSURFACE_TAGpublic final static StringDRAW_TAG
-
Method Summary
Modifier and Type Method Description final static UnitRiveUI(RiveFile file, Modifier modifier, Artboard artboard, String stateMachineName, ViewModelInstance viewModelInstance, Fit fit, Alignment alignment, Integer clearColor)The main composable for rendering a Rive file's artboard and state machine. -
-
Method Detail
-
RiveUI
@Composable() final static Unit RiveUI(RiveFile file, Modifier modifier, Artboard artboard, String stateMachineName, ViewModelInstance viewModelInstance, Fit fit, Alignment alignment, Integer clearColor)
The main composable for rendering a Rive file's artboard and state machine.
Internally, RiveUI uses a TextureView to create and manage a Surface for rendering.
The composable will advance the state machine and draw the artboard on every frame while the Lifecycle is in the Lifecycle.State.RESUMED state. It will also handle pointer input events to influence the state machine, such as pointer down, move, and up events.
A RiveUI composable can enter a settled state, where it stops advancing the state machine. It will be restarted when influenced by other events, such as pointer input or view model instance changes.
- Parameters:
file- The RiveFile that created the artboard and state machine.modifier- The Modifier to apply to the composable.artboard- The Artboard to render.stateMachineName- The name of the state machine to use.viewModelInstance- The ViewModelInstance to bind to the state machine.fit- The Fit to use for the artboard.alignment- The Alignment to use for the artboard.clearColor- The color to clear the surface with before drawing.
-
-
-
-