BatchBuilder2D
Allows to draw quads and sprites buffering the geometry to limit the draw batches executed calling AG (Accelerated Graphics). This class handles a vertex structure of: x, y, u, v, colorMul. Allowing to draw texturized and tinted primitives.
You should call: drawQuad, drawQuadFast, drawNinePatch, drawVertices for buffering the geometries.
For performance the actual drawing/rendering doesn't happen until the flush method is called (normally that happens automatically). Then the engine will call flush when required, automatically once the buffer is filled, at the end of the frame, or when RenderContext.flush is executed by other renderers.
Types
Properties
The current color mask state. If you change it, you must call the flush method to ensure everything has been drawn.
Maximum number of indices that can be buffered here in a single batch. It depens on the maxQuads parameter
Maximum number of vertices that can be buffered here in a single batch. It depens on the maxQuads parameter
Maximum number of quads that could be drawn in a single batch. Bigger numbers will increase memory usage, but might reduce the number of batches per frame when using the same texture and properties.
The current stencil state. If you change it, you must call the flush method to ensure everything has been drawn.
Functions
Draws/buffers a set of textured and colorized array of vertices array with the current state previously set by calling setStateFast.
When there are vertices pending, this performs a AG.draw call flushing all the buffered geometry pending to draw
Sets the current texture tex, smoothing, blendMode and program that will be used by the following drawing calls not specifying these attributes.