Members
The total time to play the animation in milliseconds
frames GifFrame[] readonly
Animation frames
Height of the animation
textures Texture<CanvasSource>[] readonly
Textures
Total number of frames in the animation
Width of the animation
Methods
Create an animated GIF animation from a GIF image's ArrayBuffer. The easiest way to get the buffer is to use Assets.
Name | Type | Attributes | Description |
---|---|---|---|
buffer |
ArrayBuffer |
GIF image arraybuffer from Assets. |
|
options |
GifBufferOptions |
<optional> |
Optional options to use when building from buffer. |
Returns:
Type | Description |
---|---|
GifSource |
Example
import { GifSource, GifSprite } from 'pixi.js/gif';
const buffer = await fetch('./file.gif').then(res => res.arrayBuffer());
const source = GifSource.from(buffer);
const sprite = new GifSprite(source);
Destroy animation data and don't use after this