npm.io
1.0.6 • Published 6 years ago

phaser-animate

Licence
ISC
Version
1.0.6
Deps
6
Size
76 kB
Vulns
6
Weekly
0
Stars
2

phaser-animate

animate.css for Phaser, Automatic conversion based on animate.css

ps:the core is Exhausting all the css rules animate.css used.so if animate.css use some rules that never used before, some animation might be wrong.

DEMO

Demo

Usage

import { animate, list } from 'animate4phaser'
// supported animationList
console.log(list)

const boy = new Phaser.GameObjects.Image(this.scene, 0, 0, src);

animate({
    targets: boy,
    name: 'bounce',
}).then((e)=>{
    // e => boy
    console.log(e)
})

Options

option necessary type desc
targets yes Phaser.GameObject -
name yes String supported animation name
time no Number animate duration
mode no String 'backwards' or 'forwards', default 'backwards'
tweenScale no Number Range of motion, default 1
Develop
// install dependencies
yarn

// run dev mode
yarn start

// get lastest animate.css code and transform
yarn tran

// build
yarn build