FileAssetLoader

abstract class FileAssetLoader : NativeObject

Base class for asset loading. Overload loadContents to customize the loading process.

This allows you to choose how assets, i.e. images, fonts, and audio, are loaded when referenced by a Rive file. This is especially useful for referenced assets which you may want to load once and supply to multiple Rive files, e.g. for expensive font files.

Asset loaders are typed to a specific RendererType via setRendererType. This is because images are renderer specific, and the asset loader is ultimately what creates FileAssets.

Apply it to a RiveAnimationView in one of the following ways:

Inheritors

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

Getter/Setter for the underlying C++ pointer value.

Link copied to clipboard
Link copied to clipboard

Whether this objects underlying pointer is still valid.

Link copied to clipboard
open val refCount: Int
Link copied to clipboard
override var refs: AtomicInteger

Functions

Link copied to clipboard
open override fun acquire(): Int

Increments the references for this counter. Cannot be used for initialization - use refs.incrementAndGet instead.

Link copied to clipboard
open external override fun cppDelete(pointer: Long)
Link copied to clipboard
external fun cppRef(pointer: Long)
Link copied to clipboard
abstract fun loadContents(asset: FileAsset, inBandBytes: ByteArray): Boolean

Override to customize the asset loading process.

Link copied to clipboard
open override fun release(): Int

Decrements the reference counter.

Link copied to clipboard
fun setRendererType(rendererType: RendererType)