Description

This plugin is a set of helpers to provide a better integration of Fatina with javascript games library like PixiJs or Phaser. It provides helpers to animate:

  • Position: Move, Shake, PunchPosition
  • Rotation: Rotate, PunchRotate
  • Scale: Scale, PunchScale
  • Alpha: Fade
  • Color: Color, PunchColor

This make the code smaller and easier to read

// normal fatina tween
Fatina.tween(sprite.position, ['x']).to({'x': 50 }, 1000);

// same operation with the helper
sprite.moveXTo(50, 1000);

This also provides conversion for angle and colors

// degree rotation (default rotation are radiant)
sprite.rotateDegTo(90, 200);

// give a red tint to the sprite (most engine works with hex or rgba number array)
sprite.colorRGBTo("#FF0000", 200);
Github Download NPM Getting Started API