Asset

sealed class Asset<H> : AutoCloseable

Base class for assets managed by a RiveWorker.

Uses ops to perform operations specific to the asset type.

Each asset holds a reference to its RiveWorker. When creating assets manually, call close when you no longer need the asset; releasing the worker alone is not enough to purge asset or worker memory while the asset remains open.

Parameters

handle

The handle to the asset on the command server.

riveWorker

The Rive worker that owns the asset.

ops

The operations for managing the asset type.

Inheritors

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val handle: H

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard
fun register(key: String)

Register the asset with the given key. When Rive fulfills a referenced asset, it will look for an asset registered under that key. The key comes from the zip file created when exporting a Rive file.

Link copied to clipboard
fun unregister(key: String)

Unregister the asset with the given key.