This class manages a list of mesh batches of different types; it acts as a "meta" MeshBatch that initiates all rendering.

### Hierarchy

- BatchProcessor

## Index

### Constructors

- constructor

### Properties

- numBatches
- onBatchComplete

### Methods

- addMesh
- clear
- dispose
- fillToken
- finishBatch
- getBatchAt
- get_numBatches
- get_onBatchComplete
- set_onBatchComplete
- trim

## Constructors

### constructor

- new BatchProcessor(): BatchProcessor

- - Defined in lib/starling/rendering/BatchProcessor.d.ts:15

  Creates a new batch processor.

  #### Returns BatchProcessor

## Properties

### numBatches

numBatches: number

- Defined in lib/starling/rendering/BatchProcessor.d.ts:56

The number of batches currently stored in the BatchProcessor.

### onBatchComplete

onBatchComplete: function

- Defined in lib/starling/rendering/BatchProcessor.d.ts:62

This callback is executed whenever a batch is finished and replaced by a new one. The finished MeshBatch is passed to the callback. Typically, this callback is used to actually render it.

#### Type declaration

- - (MeshBatch: any): void

  - #### Parameters

    - ##### MeshBatch: any

    #### Returns void

## Methods

### addMesh

- addMesh(mesh: Mesh, state: RenderState, subset?: MeshSubset, ignoreTransformations?: boolean): void

- - Defined in lib/starling/rendering/BatchProcessor.d.ts:35

  Adds a mesh to the current batch, or to a new one if the current one does not support it. Whenever the batch changes, `onBatchComplete` is called for the previous one.

  @param mesh the mesh to add to the current (or new) batch. @param state the render state from which to take the current settings for alpha, modelview matrix, and blend mode. @param subset the subset of the mesh you want to add, or `null` for the complete mesh. @param ignoreTransformations when enabled, the mesh's vertices will be added without transforming them in any way (no matter the value of the state's `modelviewMatrix`).

  #### Parameters

  - ##### mesh: Mesh

  - ##### state: RenderState

  - ##### Optional subset: MeshSubset

  - ##### Optional ignoreTransformations: boolean

  #### Returns void

### clear

- clear(): void

- - Defined in lib/starling/rendering/BatchProcessor.d.ts:43

  Clears all batches and adds them to a pool so they can be reused later.

  #### Returns void

### dispose

- dispose(): void

- - Defined in lib/starling/rendering/BatchProcessor.d.ts:20

  Disposes all batches (including those in the reusable pool).

  #### Returns void

### fillToken

- fillToken(token: BatchToken): BatchToken

- - Defined in lib/starling/rendering/BatchProcessor.d.ts:53

  Sets all properties of the given token so that it describes the current position within this instance.

  #### Parameters

  - ##### token: BatchToken

  #### Returns BatchToken

### finishBatch

- finishBatch(): void

- - Defined in lib/starling/rendering/BatchProcessor.d.ts:40

  Finishes the current batch, i.e. call the 'onComplete' callback on the batch and prepares initialization of a new one.

  #### Returns void

### getBatchAt

- getBatchAt(batchID: number): MeshBatch

- - Defined in lib/starling/rendering/BatchProcessor.d.ts:46

  Returns the batch at a certain index.

  #### Parameters

  - ##### batchID: number

  #### Returns MeshBatch

### Protected get_numBatches

- get_numBatches(): number

- - Defined in lib/starling/rendering/BatchProcessor.d.ts:57

  #### Returns number

### Protected get_onBatchComplete

- get_onBatchComplete(): function

- - Defined in lib/starling/rendering/BatchProcessor.d.ts:63

  #### Returns function

  - - (MeshBatch: any): void

    - #### Parameters

      - ##### MeshBatch: any

      #### Returns void

### Protected set_onBatchComplete

- set_onBatchComplete(value: function): function

- - Defined in lib/starling/rendering/BatchProcessor.d.ts:64

  #### Parameters

  - ##### value: function

    - - (MeshBatch: any): void

      - #### Parameters

        - ##### MeshBatch: any

        #### Returns void

  #### Returns function

  - - (MeshBatch: any): void

    - #### Parameters

      - ##### MeshBatch: any

      #### Returns void

### trim

- trim(): void

- - Defined in lib/starling/rendering/BatchProcessor.d.ts:49

  Disposes all batches that are currently unused.

  #### Returns void

Generated using TypeDoc