Plugin to the Pogo Game Engine that adds support for Rive animations (formerly Flare).
Rive (formerly Flare) plugin to the Pogo Game Engine.
Adding the plugin to your Pogo project #
Add the pogo_rive package dependency to your project's
pubspec.yaml, for example (check your version number):
dependencies: pogo_rive: ^0.1.0
A plugin import is required in addition to the Pogo import in each source file that uses it:
import 'package:pogo/game_engine.dart'; import 'package:pogo_rive/plugin.dart';
RiveComponent class #
The RiveComponent class is a component for use in building a GameEntity. It draws and controls a given Rive animation.
|<default>||Takes a FlutterActorArtboard by reference.|
|fromFile||Takes a Rive filename (cached or not). Returns a Future.|
TODO look into caching
|animationName *||Read-only. Name of the currently playing animation.|
|artboard *||Read-only. Reference to the source FlutterActorArtboard object.|
|debugColor||Color to draw debug-mode information. Default: |
|height||Read-only. Scaled height of the source artboard (the height that will be drawn).|
|pivot *||Pivot point for rotation and anchor point for placement. Default: |
|scale *||A scale factor can be provided to adapt the Rive's units to the app's units. Default: |
|unscaledHeight||Read-only. Unscaled height of the source artboard.|
|unscaledWidth||Read-only. Unscaled width of the source artboard.|
|width||Read-only. Scaled width of the source artboard (the width that will be drawn).|
* Also is a constructor parameter.
|loaded||Returns whether the animation has loaded yet or not.|
|render||Draws the Rive, translated by the set Pivot, at the set scale. To execute, call from a |
|setAnimation||Sets a new animation for playback by animation name.|
|update||Updates the animation state. To execute, call from a |
See the example app.
A prefab that implements RiveComponent.
An implementation of RiveComponent specific to the built-in ParticleComponent.
See Pogo's particles example app.