-
- All Implemented Interfaces:
-
app.rive.runtime.kotlin.core.RefCount
@OpenForTesting() public final class File extends NativeObject
Files are created in the rive editor.
This object has a counterpart in C++, which implements a lot of functionality. The base class's cppPointer keeps track of this relationship.
You can export these .riv files and load them up. Files can contain multiple artboards.
If the given file cannot be loaded this will throw a RiveException. The Rive File format is evolving, and while we attempt to keep backwards (and forwards) compatibility where possible, there are times when this is not possible.
The rive editor will always let you download your file in the latest runtime format.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classFile.EnumThe name and values of an enum, whether system or user defined.
-
Field Summary
Fields Modifier and Type Field Description private final ReentrantLocklockprivate final ArtboardfirstArtboardprivate final IntegerartboardCountprivate final List<String>artboardNamesprivate final List<File.Enum>enumsprivate final IntegerviewModelCountprivate final RendererTyperendererTypeprivate final BooleanhasCppObjectprivate AtomicIntegerrefsprivate LongcppPointerprivate final List<RefCount>dependenciesprivate final IntegerrefCount
-
Constructor Summary
Constructors Constructor Description File(ByteArray bytes, RendererType rendererType, FileAssetLoader fileAssetLoader)
-
Method Summary
-
-
Constructor Detail
-
File
File(ByteArray bytes, RendererType rendererType, FileAssetLoader fileAssetLoader)
-
-
Method Detail
-
getLock
final ReentrantLock getLock()
-
getFirstArtboard
final Artboard getFirstArtboard()
-
getArtboardCount
final Integer getArtboardCount()
-
getArtboardNames
final List<String> getArtboardNames()
-
getViewModelCount
final Integer getViewModelCount()
-
getRendererType
final RendererType getRendererType()
-
getHasCppObject
final Boolean getHasCppObject()
-
getRefs
final AtomicInteger getRefs()
-
setRefs
final Unit setRefs(AtomicInteger refs)
-
getCppPointer
final Long getCppPointer()
-
setCppPointer
final Unit setCppPointer(Long cppPointer)
-
getDependencies
final List<RefCount> getDependencies()
-
getRefCount
Integer getRefCount()
-
getViewModelByIndex
final ViewModel getViewModelByIndex(Integer viewModelIdx)
Get the ViewModel definition from the file.
- Parameters:
viewModelIdx- The Rive file 0-based index of the ViewModel.
-
getViewModelByName
final ViewModel getViewModelByName(String viewModelName)
Get the ViewModel definition from the file.
- Parameters:
viewModelName- The Rive file name of the ViewModel.
-
defaultViewModelForArtboard
final ViewModel defaultViewModelForArtboard(Artboard artboard)
Get the default ViewModel for an Artboard. Usually this will be the ViewModel intended for use with this artboard.
- Parameters:
artboard- The artboard to get the default ViewModel for.
-
-
-
-