Class: DefaultBatcher

DefaultBatcher

The default batcher is used to batch quads and meshes. This batcher will batch the following elements:

  • tints
  • roundPixels
  • texture
  • transform

new DefaultBatcher ()

Extends

Members

vertexSize number overrides

The size of one attribute. 1 = 32 bit. x, y, u, v, color, textureIdAndRound -> total = 6

Default Value:
  • 6

Methods

packAttributes (element, float32View, uint32View, index, textureId) overrides

Packs the attributes of a DefaultBatchableMeshElement into the provided views.

Name Type Description
element DefaultBatchableMeshElement

The DefaultBatchableMeshElement 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.

packQuadAttributes (element, float32View, uint32View, index, textureId) overrides

Packs the attributes of a DefaultBatchableQuadElement into the provided views.

Name Type Description
element DefaultBatchableQuadElement

The DefaultBatchableQuadElement 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.

Inherited Properties

From class Batcher

attributeBuffer ViewableBuffer inherited

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

attributeSize number inherited

The current size of the attribute data in the batch.

batches Batch[] inherited

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

batchIndex number inherited

The current index of the batch being processed.

Default Value:
  • 0

dirty boolean inherited

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

Default Value:
  • true

elementSize number inherited

The total number of elements currently in the batch.

elementStart number inherited

The starting index of elements in the current batch.

geometry Geometry inherited

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

indexBuffer IndexBufferArray inherited

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

indexSize number inherited

The current size of the index data in the batch.

maxTextures number readonly inherited

The maximum number of textures per batch.

name string inherited

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

shader Shader inherited

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

uid number readonly inherited

unique id for this batcher

Inherited Methods

From class Batcher

break (instructionSet) inherited

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)

Name Type Description
instructionSet InstructionSet

ensureAttributeBuffer (size) inherited

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

Name Type Description
size number

the size in vertices to ensure (not bytes!)

ensureIndexBuffer (size) inherited

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

Name Type Description
size number

the size in vertices to ensure (not bytes!)