Base class for a drawing batch, used to draw a collection of sprites or shapes.
Kind: global class
Create the draw batch.
Effect
Get the default effect to use for this drawing batch type.
Kind: instance property of DrawBatch
Returns: Effect
- Default effect to use for this drawing batch.
Get the BuffersUsage enum.
Kind: instance property of DrawBatch
See: BuffersUsage
Boolean
Return if the batch was destroyed.
Kind: instance property of DrawBatch
Returns: Boolean
- True if batch was destoryed.
Boolean
Return if the batch is currently drawing.
Kind: instance property of DrawBatch
Returns: Boolean
- If the batch began drawing.
Boolean
Return if this batch was turned static.
Kind: instance property of DrawBatch
Returns: Boolean
- True if its a static batch you can no longer change.
Get the default blend mode to use for this drawing batch.
Kind: instance property of DrawBatch
Make the batch buffers static. This means you won’t be able to change the drawings in this batch once end() is called, but you’ll be able to redraw the batch with different effects and transformations without copying any data, and much faster. This also free up some internal arrays, thus reducing the memory used for this batch. Note: must be called after ‘begin()’ and right before the ‘end()’ call.
Kind: instance method of DrawBatch
Destroy the batch and free any resources assigned to it.
Kind: instance method of DrawBatch
Set the way we mark the buffers we pass to the GPU based on expected behavior. Use StreamDraw if you want to set buffers once, and use them in GPU few times. Use DynamicDraw if you want to set buffers many times, and use them in GPU many times. Use StaticDraw if you want to set buffers once, and use them in GPU many times.
Kind: instance method of DrawBatch
Param | Type | Description |
---|---|---|
usage | BuffersUsage |
Buffers usage. |
Start drawing this batch. You must call this before doing any draw calls.
Kind: instance method of DrawBatch
Param | Type | Description |
---|---|---|
[blendMode] | BlendModes |
Blend mode to draw this batch in. |
[effect] | Effect |
Effect to use. If not defined will use this batch type default effect. |
[transform] | Matrix |
Optional transformations to apply on all sprites. |
[overrideEffectFlags] | \* |
Optional flags to override effect’s defaults. Possible keys: {enableDepthTest, enableFaceCulling, enableStencilTest, enableDithering}. |
Finish drawing without presenting on screen.
Kind: instance method of DrawBatch
End drawing and present whatever left in buffers on screen.
Kind: instance method of DrawBatch
Draw whatever is currently in buffers without ending the draw batch.
Kind: instance method of DrawBatch
Clear this buffer from any drawings in it. Called internally if ‘preserveBuffers’ is not true.
Kind: instance method of DrawBatch