Plugin to support playback of animated GIF images in PixiJS. Unlike normal GIF playback in the browser, this plugins allows you to stop, loop, change speed, or go to a specific frame.
Install the loader for handle GIF images.
import { AnimatedGIFLoader } from '@pixi/gif';
import { Loader } from '@pixi/loaders';
Loader.registerPlugin(AnimatedGIFLoader);
Load an animated GIF image.
import { Application } from 'pixi.js';
const app = new Application();
app.loader.add('image', 'image.gif');
app.loader.load((loader, resources) => {
const image = resources.image.animation;
app.stage.addChild(image);
});