pixi.js
    Preparing search index...

    Class GifSourceAdvanced

    Resource provided to GifSprite instances. This is very similar to using a shared Texture between Sprites. This source contains all the frames and animation needed to support playback.

    Index

    Constructors

    Properties

    duration: number

    The total time to play the animation in milliseconds

    frames: GifFrame[]

    Animation frames

    height: number

    Height of the animation

    textures: Texture<CanvasSource>[]

    Textures

    totalFrames: number

    Total number of frames in the animation

    width: number

    Width of the animation

    Methods

    • Destroy animation data and don't use after this

      Returns void

    • Create an animated GIF animation from a GIF image's ArrayBuffer. The easiest way to get the buffer is to use Assets.

      Parameters

      • buffer: ArrayBuffer

        GIF image arraybuffer from Assets.

      • Optionaloptions: GifBufferOptions

        Optional options to use when building from buffer.

      Returns GifSource

      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);