RiveFile

A Rive file which contains one or more artboards, state machines, and view model instances.

A Rive file is created from the Rive editor and is exported as a .riv file.

Create an instance of this class using rememberRiveFile or RiveFile.fromSource. When using the latter, make sure to call close when you are done with the file to release its resources. A manually-created file holds a reference to its RiveWorker, so releasing the worker alone is not enough to purge the file or worker memory while this file remains open.

This object can be used to query the file for its contents, such as artboards names. It can then be passed to rememberArtboard to create an Artboard, and then to Rive for rendering.

Queries are cached for performance.

Parameters

fileHandle

The handle to the file on the command server.

riveWorker

The Rive worker that owns and performs operations on this file.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard
suspend fun getArtboardNames(): List<String>
Link copied to clipboard
Link copied to clipboard
suspend fun getEnums(): List<File.Enum>
Link copied to clipboard
suspend fun getViewModelInstanceNames(viewModel: String): List<String>
Link copied to clipboard
suspend fun getViewModelNames(): List<String>
Link copied to clipboard