Name | Type | Description |
---|---|---|
renderer |
PIXI.brend.BatchRenderer |
Implements
Members
-
Batch geometries that can be reused.
-
geometryMerger PIXI.brend#IGeometryMerger
-
This lazy getter returns the geometry-merger function. This function takes one argument - the display-object to be appended to the batch - and pushes its geometry to the batch geometry.
You can overwrite this property with a custom geometry-merger function if customizing
PIXI.brend.BatchGeometryFactory
.
Methods
-
Append's the display-object geometry to this batch's geometry. You must override this you need to "modify" the geometry of the display-object before merging into the composite geometry (for example, adding an ID to a special uniform)
Name Type Description targetObject
PIXI.DisplayObject batch
number -
This should wrap up the batch geometry in a
PIXI.Geometry
object.Returns:
Type Description PIXI.Geometry the generated batch geometry Example
build(): PIXI.Geometry { // Make sure you're not allocating new geometries if _geometryPool has some // already. (Otherwise, a memory leak will result!) const geom: ExampleGeometry = (this._geometryPool.pop() || new ExampleGeometry( // ...your arguments... //)) as ExampleGeometry; // Put data into geometry's buffer return geom; }
-
Allocates an attribute buffer with sufficient capacity to hold
size
elements.Name Type Description size
number -
Allocates an index buffer (
Uint16Array
) with sufficient capacity to holdsize
indices.Name Type Description size
-
Ensures this factory has enough space to buffer the given number of vertices and indices. This should be called before feeding display-objects from the batch.
Name Type Description verticesBatched
number indiciesBatched
number -
This is used to return a batch geometry so it can be pooled and reused in a future
build()
call.Name Type Description geom
PIXI.Geometry releases back the geometry to be reused. It is expected that it is not used externally again.