2.0.3 • Published 2 years ago

@felixgro/animate-canvas v2.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Animate-Canvas

A minimal library for frame-independent Canvas2D or WebGL animations.

It's as simple as that:

animateCanvas(canvas, '2d', (ctx, delta) => {
	// animation logic..
}).start();

Features

  • 2d and WebGL Support
  • FPS-Graph
  • Frame-Independent animations
  • Auto-Pause when invisible

Getting Started

Install using NPM or Yarn:

npm install @felixgro/animate-canvas

Start animating:

import { animateCanvas } from '@felixgro/animate-canvas';

const animation = animateCanvas(canvasElement, '2d' | 'webgl', frameHandler);

// Change playstate..
animation.start();
animation.stop();

// Access active rendering context
animation.ctx

You may chain playstate methods:

const animation = animateCanvas(...).start();
2.0.3

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago

0.1.0

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago