Code Monkey home page Code Monkey logo

flame_flare's Introduction

Pub Test Discord

Flame Flare

Integrate awesome Flare animations to your Flame game.

Install

Add flame_flare as a dependency in your pubspec.yaml file (what?).

Import the package:

import 'package:flame_flare/flame_flare.dart';

Usage

This lib exposes a set of tools to integrate a flare animation into a flame game, they are:

  • FlareActorAnimation: A simple animation object that wraps a FlareActorRenderBox.
  • FlareActorComponent: A Flame's PositionComponent sub class that receives and render a FlareActorAnimation.
  • FlareParticle: A Flame's Particle sub class that receives and renders a FlareActorAnimation as a particle.

Simple usage

class MyAnimationController extends FlareControls {
  void playSomeAnimation() {
    play("Some animation");
  }
}

class MyAnimationComponent extends FlareActorComponent {
  final MyAnimationController animationController;

  MyAnimationComponent(this.animationController)
      : super(FlareActorAnimation(
          'assets/my_animation.flr',
          controller: animationController,
          fit: BoxFit.contain,
          alignment: Alignment.bottomCenter,
          width: 306,
          height: 500,
        ));
}

See the example app for a slightly more complex usage.

Support

The simplest way to show us your support is by giving the project a star.

You can also support us by becoming a patron on Patreon: Patreon

Or by making a single donation by buying us a coffee: Buy Me A Coffee

flame_flare's People

Contributors

renancaraujo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.