animate4phaser
v1.0.5
Published
animate4phaser
Downloads
3
Readme
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
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