ecspresso
    Preparing search index...
    • Slice a grid-arranged sprite sheet into a clip. Use when you don't have a TexturePacker JSON — just an image and uniform cell dimensions. Cells are walked row-major.

      Specify exactly one of rows, count, or indices to define the cell set (along with columns). Combining count and indices is rejected.

      Returns a Promise because pixi.js is imported lazily — keeps the static module graph free of a runtime pixi dependency for consumers who only use the sheet-based helpers.

      Parameters

      • input: {
            columns: number;
            count?: number;
            frameDuration?: number;
            frameDurations?: readonly number[];
            frameHeight: number;
            frameWidth: number;
            indices?: readonly number[];
            loop?: AnimationLoopMode;
            margin?: number;
            rows?: number;
            source: TextureSource;
            spacing?: number;
        }
        • columns: number
        • Optionalcount?: number

          Number of cells to use, walked row-major. Mutually exclusive with indices.

        • OptionalframeDuration?: number
        • OptionalframeDurations?: readonly number[]
        • frameHeight: number
        • frameWidth: number
        • Optionalindices?: readonly number[]

          Explicit row-major, 0-based cell indices. Mutually exclusive with count.

        • Optionalloop?: AnimationLoopMode
        • Optionalmargin?: number

          Pixels around the sheet edge.

        • Optionalrows?: number
        • source: TextureSource
        • Optionalspacing?: number

          Pixels between cells.

      Returns Promise<SpriteAnimationClip>

      const tex = await Assets.load<Texture>('/coin.png');
      const clip = await clipFromGrid({
      source: tex.source,
      frameWidth: 16, frameHeight: 16,
      columns: 8, count: 8,
      frameDuration: 1 / 10,
      });