pixi.js
    Preparing search index...

    Class BatcherAbstract Advanced

    A batcher is used to batch together objects with the same texture. It is an abstract class that must be extended. see DefaultBatcher for an example.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    attributeBuffer: ViewableBuffer

    The buffer containing attribute data for all elements in the batch.

    attributeSize: number

    The current size of the attribute data in the batch.

    batches: Batch[] = []

    An array of all batches created during the current rendering process.

    batchIndex: number = 0

    The current index of the batch being processed.

    dirty: boolean = true

    Indicates whether the batch data has been modified and needs updating.

    elementSize: number

    The total number of elements currently in the batch.

    elementStart: number

    The starting index of elements in the current batch.

    geometry: Geometry

    The geometry used by this batcher. Must be implemented by subclasses.

    indexBuffer: IndexBufferArray

    The buffer containing index data for all elements in the batch.

    indexSize: number

    The current size of the index data in the batch.

    maxTextures: number

    The maximum number of textures per batch.

    name: string

    The name of the batcher. Must be implemented by subclasses.

    shader: Shader

    The shader used by this batcher. Must be implemented by subclasses. this can be shared by multiple batchers of the same type.

    uid: number = ...

    unique id for this batcher

    defaultOptions: Partial<BatcherOptions> = ...

    Methods

    • Returns void

    • breaks the batcher. This happens when a batch gets too big, or we need to switch to a different type of rendering (a filter for example)

      Parameters

      Returns void

    • Returns void

    • Resizes the attribute buffer to the given size (1 = 1 float32)

      Parameters

      • size: number

        the size in vertices to ensure (not bytes!)

      Returns void

    • Resizes the index buffer to the given size (1 = 1 float32)

      Parameters

      • size: number

        the size in vertices to ensure (not bytes!)

      Returns void

    • Packs the attributes of a BatchableMeshElement into the provided views. Must be implemented by subclasses.

      Parameters

      • element: BatchableMeshElement

        The BatchableMeshElement to pack.

      • float32View: Float32Array

        The Float32Array view to pack into.

      • uint32View: Uint32Array

        The Uint32Array view to pack into.

      • index: number

        The starting index in the views.

      • textureId: number

        The texture ID to use.

      Returns void

    • Packs the attributes of a BatchableQuadElement into the provided views. Must be implemented by subclasses.

      Parameters

      • element: BatchableQuadElement

        The BatchableQuadElement to pack.

      • float32View: Float32Array

        The Float32Array view to pack into.

      • uint32View: Uint32Array

        The Uint32Array view to pack into.

      • index: number

        The starting index in the views.

      • textureId: number

        The texture ID to use.

      Returns void

    • Parameters

      Returns void