pogo_rive 0.1.0
pogo_rive: ^0.1.0

Flutter Android iOS

Plugin to the Pogo Game Engine that adds support for Rive animations (formerly Flare).

pogo_rive #

Rive (formerly Flare) plugin to the Pogo Game Engine.

Rive is a design tool for vector-based animation. The Flare-Flutter package does the bulk of the work.

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.

Constructors #

<default>Takes a FlutterActorArtboard by reference.
fromFileTakes a Rive filename (cached or not). Returns a Future.

TODO look into caching

Properties #

animationName *Read-only. Name of the currently playing animation.
artboard *Read-only. Reference to the source FlutterActorArtboard object.
debugColorColor to draw debug-mode information. Default: Color(0xFFFF00FF) magenta.
heightRead-only. Scaled height of the source artboard (the height that will be drawn).
pivot *Pivot point for rotation and anchor point for placement. Default: System.defaultPivot which defaults to Pivot.center.
scale *A scale factor can be provided to adapt the Rive's units to the app's units. Default: 1.0.
unscaledHeightRead-only. Unscaled height of the source artboard.
unscaledWidthRead-only. Unscaled width of the source artboard.
widthRead-only. Scaled width of the source artboard (the width that will be drawn).

* Also is a constructor parameter.

Methods #

loadedReturns whether the animation has loaded yet or not.
renderDraws the Rive, translated by the set Pivot, at the set scale. To execute, call from a GameEnity.update().
setAnimationSets a new animation for playback by animation name.
updateUpdates the animation state. To execute, call from a GameEnity.update().

See the example app.

RivePrefab #

A prefab that implements RiveComponent.

RiveParticle #

An implementation of RiveComponent specific to the built-in ParticleComponent.

See Pogo's particles example app.

1
likes
80
pub points
0%
popularity

Plugin to the Pogo Game Engine that adds support for Rive animations (formerly Flare).

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

littlebigspeed@gmail.com

License

MIT (LICENSE)

Dependencies

flare_flutter, flutter, pogo

More

Packages that depend on pogo_rive