Abstract Class: Batcher
Defined in: node_modules/pixi.js/lib/rendering/batcher/shared/Batcher.d.ts:207
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.
Advanced
Extended by
Constructors
Constructor
> new Batcher(options): Batcher
Defined in: node_modules/pixi.js/lib/rendering/batcher/shared/Batcher.d.ts:265
Parameters
options
Returns
Batcher
Properties
attributeBuffer
> attributeBuffer: ViewableBuffer
Defined in: node_modules/pixi.js/lib/rendering/batcher/shared/Batcher.d.ts:212
The buffer containing attribute data for all elements in the batch.
attributeSize
> attributeSize: number
Defined in: node_modules/pixi.js/lib/rendering/batcher/shared/Batcher.d.ts:216
The current size of the attribute data in the batch.
batches
> batches: Batch[]
Defined in: node_modules/pixi.js/lib/rendering/batcher/shared/Batcher.d.ts:228
An array of all batches created during the current rendering process.
batchIndex
> batchIndex: number
Defined in: node_modules/pixi.js/lib/rendering/batcher/shared/Batcher.d.ts:226
The current index of the batch being processed.
dirty
> dirty: boolean
Defined in: node_modules/pixi.js/lib/rendering/batcher/shared/Batcher.d.ts:224
Indicates whether the batch data has been modified and needs updating.
elementSize
> elementSize: number
Defined in: node_modules/pixi.js/lib/rendering/batcher/shared/Batcher.d.ts:220
The total number of elements currently in the batch.
elementStart
> elementStart: number
Defined in: node_modules/pixi.js/lib/rendering/batcher/shared/Batcher.d.ts:222
The starting index of elements in the current batch.
geometry
> abstract geometry: Geometry
Defined in: node_modules/pixi.js/lib/rendering/batcher/shared/Batcher.d.ts:239
The geometry used by this batcher. Must be implemented by subclasses.
indexBuffer
> indexBuffer: IndexBufferArray
Defined in: node_modules/pixi.js/lib/rendering/batcher/shared/Batcher.d.ts:214
The buffer containing index data for all elements in the batch.
indexSize
> indexSize: number
Defined in: node_modules/pixi.js/lib/rendering/batcher/shared/Batcher.d.ts:218
The current size of the index data in the batch.
maxTextures
> readonly maxTextures: number
Defined in: node_modules/pixi.js/lib/rendering/batcher/shared/Batcher.d.ts:233
The maximum number of textures per batch.
name
> abstract name: string
Defined in: node_modules/pixi.js/lib/rendering/batcher/shared/Batcher.d.ts:235
The name of the batcher. Must be implemented by subclasses.
shader
> abstract shader: Shader
Defined in: node_modules/pixi.js/lib/rendering/batcher/shared/Batcher.d.ts:244
The shader used by this batcher. Must be implemented by subclasses. this can be shared by multiple batchers of the same type.
uid
> readonly uid: number
Defined in: node_modules/pixi.js/lib/rendering/batcher/shared/Batcher.d.ts:210
unique id for this batcher
vertexSize
> abstract protected vertexSize: number
Defined in: node_modules/pixi.js/lib/rendering/batcher/shared/Batcher.d.ts:237
The vertex size of the batcher. Must be implemented by subclasses.
defaultOptions
> static defaultOptions: Partial<BatcherOptions>
Defined in: node_modules/pixi.js/lib/rendering/batcher/shared/Batcher.d.ts:208
Methods
add()
> add(batchableObject): void
Defined in: node_modules/pixi.js/lib/rendering/batcher/shared/Batcher.d.ts:267
Parameters
batchableObject
Returns
void
begin()
> begin(): void
Defined in: node_modules/pixi.js/lib/rendering/batcher/shared/Batcher.d.ts:266
Returns
void
break()
> break(instructionSet): void
Defined in: node_modules/pixi.js/lib/rendering/batcher/shared/Batcher.d.ts:275
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
instructionSet
Returns
void
checkAndUpdateTexture()
> checkAndUpdateTexture(batchableObject, texture): boolean
Defined in: node_modules/pixi.js/lib/rendering/batcher/shared/Batcher.d.ts:268
Parameters
batchableObject
texture
Returns
boolean
destroy()
> destroy(options?): void
Defined in: node_modules/pixi.js/lib/rendering/batcher/shared/Batcher.d.ts:297
Destroys the batch and its resources.
Parameters
options?
destruction options
shader?
boolean
whether to destroy the associated shader
Returns
void
ensureAttributeBuffer()
> ensureAttributeBuffer(size): void
Defined in: node_modules/pixi.js/lib/rendering/batcher/shared/Batcher.d.ts:282
Resizes the attribute buffer to the given size (1 = 1 float32)
Parameters
size
number
the size in vertices to ensure (not bytes!)
Returns
void
ensureIndexBuffer()
> ensureIndexBuffer(size): void
Defined in: node_modules/pixi.js/lib/rendering/batcher/shared/Batcher.d.ts:287
Resizes the index buffer to the given size (1 = 1 float32)
Parameters
size
number
the size in vertices to ensure (not bytes!)
Returns
void
finish()
> finish(instructionSet): void
Defined in: node_modules/pixi.js/lib/rendering/batcher/shared/Batcher.d.ts:277
Parameters
instructionSet
Returns
void
packAttributes()
> abstract packAttributes(element, float32View, uint32View, index, textureId): void
Defined in: node_modules/pixi.js/lib/rendering/batcher/shared/Batcher.d.ts:254
Packs the attributes of a BatchableMeshElement into the provided views. Must be implemented by subclasses.
Parameters
element
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
packIndex()
> packIndex(element, indexBuffer, index, indicesOffset): void
Defined in: node_modules/pixi.js/lib/rendering/batcher/shared/Batcher.d.ts:291
Parameters
element
indexBuffer
index
number
indicesOffset
number
Returns
void
packQuadAttributes()
> abstract packQuadAttributes(element, float32View, uint32View, index, textureId): void
Defined in: node_modules/pixi.js/lib/rendering/batcher/shared/Batcher.d.ts:264
Packs the attributes of a BatchableQuadElement into the provided views. Must be implemented by subclasses.
Parameters
element
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
packQuadIndex()
> packQuadIndex(indexBuffer, index, indicesOffset): void
Defined in: node_modules/pixi.js/lib/rendering/batcher/shared/Batcher.d.ts:290
Parameters
indexBuffer
index
number
indicesOffset
number
Returns
void
updateElement()
> updateElement(batchableObject): void
Defined in: node_modules/pixi.js/lib/rendering/batcher/shared/Batcher.d.ts:269
Parameters
batchableObject
Returns
void