-
public class Rive
-
-
Field Summary
Fields Modifier and Type Field Description private RendererTypedefaultRendererTypepublic final static RiveINSTANCE
-
Method Summary
Modifier and Type Method Description final Unitinit(Context context, RendererType defaultRenderer)Initialises Rive. final UnitinitializeCppEnvironment()Initialises the JNI Bindings. final RectFcalculateRequiredBounds(Fit fit, Alignment alignment, RectF availableBounds, RectF artboardBounds, Float scaleFactor)final BooleansetFallbackFont(ByteArray byteArray)Set a fallback font for the Rive runtime. final BooleansetFallbackFont(Fonts.FontOpts opts)Set a fallback font for the Rive runtime. final RendererTypegetDefaultRendererType()Public getter for the default renderer type. final UnitsetDefaultRendererType(RendererType defaultRendererType)-
-
Method Detail
-
init
final Unit init(Context context, RendererType defaultRenderer)
Initialises Rive.
This loads the C++ libraries required to use Rive objects and then makes sure to initialize the C++ environment.
To handle loading .so files for the rive-android lib yourself, use initializeCppEnvironment instead.
- Parameters:
defaultRenderer- The default renderer to use when initializing File or RiveAnimationView.
-
initializeCppEnvironment
final Unit initializeCppEnvironment()
Initialises the JNI Bindings.
We update the C++ environment with a pointer to the JavaVM so that it can interact with JVM objects.
Normally done as part of init, and only required if you are avoiding calling init.
-
calculateRequiredBounds
final RectF calculateRequiredBounds(Fit fit, Alignment alignment, RectF availableBounds, RectF artboardBounds, Float scaleFactor)
-
setFallbackFont
@Deprecated(message = Prefer defining a `FontFallbackStrategy` instead, level = DeprecationLevel.WARNING) final Boolean setFallbackFont(ByteArray byteArray)
Set a fallback font for the Rive runtime.
- Parameters:
byteArray- The ByteArray bytes for a font file.
-
setFallbackFont
@Deprecated(message = Prefer defining a `FontFallbackStrategy` instead, level = DeprecationLevel.WARNING) final Boolean setFallbackFont(Fonts.FontOpts opts)
Set a fallback font for the Rive runtime.
- Parameters:
opts- The Fonts.FontOpts specifying the desired font characteristics.
-
getDefaultRendererType
final RendererType getDefaultRendererType()
Public getter for the default renderer type.
This can be customized via Rive.init.
-
setDefaultRendererType
final Unit setDefaultRendererType(RendererType defaultRendererType)
-
-
-
-