ViewModel

A description of a ViewModel in the Rive file. It can be used to retrieve property definitions at runtime. However, properties cannot be modified - that requires an instance. Use one of the createInstance methods to create an instance with mutable properties from this ViewModel.

Parameters

unsafeCppPointer

Pointer to the C++ counterpart.

fileLock

Lock shared by this view model's File and native objects derived from it.

Types

Link copied to clipboard
data class Property(val type: ViewModel.PropertyDataType, val name: String)

A description of a property in the ViewModel.

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

The number of instances of this ViewModel. Useful for index-based iteration.

Link copied to clipboard

Get the name of the ViewModel.

Link copied to clipboard

The available properties of the ViewModel.

Link copied to clipboard

The number of properties in this ViewModel.

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 fun cppDelete(pointer: Long)
Link copied to clipboard

Create a new blank ViewModelInstance. Use Artboard::setViewModel to apply it. The instance name will be an empty string.

Link copied to clipboard

Create a new ViewModelInstance. Use Artboard::setViewModel to apply it.

Link copied to clipboard

Create a new ViewModelInstance. Use Artboard::setViewModel to apply it.

Link copied to clipboard

Create a new ViewModelInstance. Use Artboard::setViewModel to apply it.

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

Decrements the reference counter.