set Rive Resource
fun setRiveResource(@RawRes resId: Int, artboardName: String? = null, animationName: String? = null, stateMachineName: String? = null, autoplay: Boolean = controller.autoplay, autoBind: Boolean = false, fit: Fit = Fit.fromIndex(fitIndexDefault), alignment: Alignment = Alignment.fromIndex(alignmentIndexDefault), loop: Loop = Loop.fromIndex(loopIndexDefault))
Load the resource ID as a Rive file into the view.
Parameters
res Id
The resource ID to load.
artboard Name
Optionally provide an named artboard to use. Defaults to the first artboard in the file.
animation Name
Optionally provide an named animation to load. If not supplied, playing will default to the first animation.
state Machine Name
Optionally provide a named state machine to load.
autoplay
Enable autoplay to start the animation automatically.
fit
Configure how the animation should be resized to fit its container.
alignment
Configure how the animation should be aligned to its container.
loop
Configure if animations should loop, play once, or ping-pong back and forth. Defaults to the setup in the Rive file.
Throws
if artboardName or animationName are set and do not exist in the file.