@al-engine/animation
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

Al engine

SpriteAnimation

This is module for Sprite Animation for Al engine.

  // You need asset which is PNG file with frames lined vertically
  // and object where keys is a animation names and value is array of indexes of frames in PNG
  const animationData = new AnimationData(
    asset,
    { animationName: framesIndexes }
  );
  
  // You use animationData and set speed for animation
  const animation = new SpriteAnimation(animationData, animationSpeed);

  // each game frame you call [loop] method to get sprite for this frame
  const sprite = animation.loop('animationName', delta);

Readme

Keywords

none

Package Sidebar

Install

npm i @al-engine/animation

Weekly Downloads

4

Version

0.1.0

License

MIT

Unpacked Size

34.9 kB

Total Files

12

Last publish

Collaborators

  • sasha-z