Interface: IBatchGeometryFactory

.brend.IBatchGeometryFactory

This interface defines the methods you need to implement to creating your own batch geometry factory.

The constructor of an implementation should take only one argument - the batch renderer.

Methods

append (displayObject, batch)

Adds the display-object to the batch geometry.

If the display-object's shader also uses textures (in uSamplers uniform), then it will be given a texture-ID to get the texture from the uSamplers array. If it uses multiple textures, then the texture-ID is an array of indices into uSamplers. The texture-attrib passed to the batch renderer sets the name of the texture-ID attribute (defualt is aTextureId).

Name Type Description
displayObject PIXI.DisplayObject
batch object

the batch

build ()PIXI.Geometry

This should wrap up the batch geometry in a PIXI.Geometry object.

Returns:
Type Description
PIXI.Geometry batch geometry

init (verticesBatched, indiciesBatched)

Called before the batch renderer starts feeding the display-objects. This can be used to pre-allocated space for the batch geometry.

Name Type Description
verticesBatched number
indiciesBatched number optional

optional when display-object's don't use a index buffer

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