-
- All Implemented Interfaces:
-
java.lang.AutoCloseable
@Stable() public final class RiveFile implements AutoCloseable
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
.rivfile.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.
The 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classRiveFile.Companion
-
Field Summary
Fields Modifier and Type Field Description private final FileHandlefileHandleprivate final CommandQueueriveWorker
-
Method Summary
Modifier and Type Method Description final FileHandlegetFileHandle()final CommandQueuegetRiveWorker()final List<String>getArtboardNames()final List<String>getViewModelNames()final List<String>getViewModelInstanceNames(String viewModel)final List<ViewModel.Property>getViewModelProperties(String viewModel)final List<File.Enum>getEnums()final DefaultViewModelInfogetDefaultViewModelInfo(Artboard artboard)-
-
Method Detail
-
getFileHandle
final FileHandle getFileHandle()
-
getRiveWorker
final CommandQueue getRiveWorker()
-
getArtboardNames
final List<String> getArtboardNames()
-
getViewModelNames
final List<String> getViewModelNames()
-
getViewModelInstanceNames
final List<String> getViewModelInstanceNames(String viewModel)
- Parameters:
viewModel- The name of the view model to get instance names for.
-
getViewModelProperties
final List<ViewModel.Property> getViewModelProperties(String viewModel)
- Parameters:
viewModel- The name of the view model to get properties for.
-
getDefaultViewModelInfo
final DefaultViewModelInfo getDefaultViewModelInfo(Artboard artboard)
- Parameters:
artboard- The artboard to query for default view model information.
-
-
-
-