react-pump
Canvas based flash like animation library.
Install
npm install react-pump
Animation lyfecycle
...
Usage
At first, import module
Pump
: this is Main react component.View
: this is animation sprite base class.
{ super // you can define any properties for the class thispoints = this } // function will be called in animation loop. { // Sprite has { context,canvas,width,height } getters. let points = this // save style this thiscontextstrokeStyle = '#000' thiscontextlineWidth = 4 thiscontext points thiscontext // restore style this }
react render function.
{ return <Pump root=RootSprite framerate=30 width=640 height=480/> }
Demo
https://yusukeshibata.github.io/react-pump/
License
MIT