T - The type of Quad2D that is returned when acquiring one with FlexBatch.draw(). This must match the class type that is
passed to the constructor.public class CompliantBatch<T extends Quad2D> extends FlexBatch<T> implements com.badlogic.gdx.graphics.g2d.Batch
FlexBatch that implements the Batch interface, so it is compatible with Stage/Actor, BitmapFont,
ParticleEffect, Sprite, and NinePatch. It creates its own default ShaderProgram, which is owned and is disposed automatically
with the CompliantBatch.
A CompliantBatch must be disposed of when no longer used to avoid leaking memory.
In addition to drawing Quad2Ds (or given subclass), if polygon support is specified in the constructor, it may also draw
Poly2Ds (or matching subclass) by submitting them to FlexBatch.draw(Batchable).
A subclass of Quad2D may be passed to the constructor to customize what is drawn (multi-texturing or other attributes).
batchableType, renderCalls, totalRenderCalls| Constructor and Description |
|---|
CompliantBatch(java.lang.Class<T> batchableType,
boolean supportPolygons)
Constructs a CompliantQuadBatch with a default shader and a capacity of 1000 quads that can be drawn per flush.
|
CompliantBatch(java.lang.Class<T> batchableType,
int maxVertices,
boolean supportPolygons)
Constructs a CompliantQuadBatch with a default shader.
|
CompliantBatch(java.lang.Class<T> batchableType,
int maxVertices,
boolean generateDefaultShader,
boolean supportPolygons)
Constructs a CompliantQuadBatch with a specified capacity and optional default shader.
|
| Modifier and Type | Method and Description |
|---|---|
void |
dispose() |
void |
draw(com.badlogic.gdx.graphics.Texture texture,
float[] spriteVertices,
int offset,
int count) |
void |
draw(com.badlogic.gdx.graphics.Texture texture,
float x,
float y) |
void |
draw(com.badlogic.gdx.graphics.Texture texture,
float x,
float y,
float width,
float height) |
void |
draw(com.badlogic.gdx.graphics.Texture texture,
float x,
float y,
float width,
float height,
float u,
float v,
float u2,
float v2) |
void |
draw(com.badlogic.gdx.graphics.Texture texture,
float x,
float y,
float originX,
float originY,
float width,
float height,
float scaleX,
float scaleY,
float rotation,
int srcX,
int srcY,
int srcWidth,
int srcHeight,
boolean flipX,
boolean flipY) |
void |
draw(com.badlogic.gdx.graphics.Texture texture,
float x,
float y,
float width,
float height,
int srcX,
int srcY,
int srcWidth,
int srcHeight,
boolean flipX,
boolean flipY) |
void |
draw(com.badlogic.gdx.graphics.Texture texture,
float x,
float y,
int srcX,
int srcY,
int srcWidth,
int srcHeight) |
void |
draw(com.badlogic.gdx.graphics.g2d.TextureRegion region,
float x,
float y) |
void |
draw(com.badlogic.gdx.graphics.g2d.TextureRegion region,
float width,
float height,
com.badlogic.gdx.math.Affine2 transform) |
void |
draw(com.badlogic.gdx.graphics.g2d.TextureRegion region,
float x,
float y,
float width,
float height) |
void |
draw(com.badlogic.gdx.graphics.g2d.TextureRegion region,
float x,
float y,
float originX,
float originY,
float width,
float height,
float scaleX,
float scaleY,
float rotation) |
void |
draw(com.badlogic.gdx.graphics.g2d.TextureRegion region,
float x,
float y,
float originX,
float originY,
float width,
float height,
float scaleX,
float scaleY,
float rotation,
boolean clockwise) |
com.badlogic.gdx.graphics.Color |
getColor() |
float |
getPackedColor() |
void |
setColor(com.badlogic.gdx.graphics.Color tint)
Sets the color used to tint images when they are added to the Batch.
|
void |
setColor(float color)
Sets the color used to tint images when they are added to the Batch.
|
void |
setColor(float r,
float g,
float b,
float a)
Sets the color used to tint images when they are added to the Batch.
|
void |
setShader(com.badlogic.gdx.graphics.glutils.ShaderProgram shader) |
applyMatrices, applyTextureUniforms, begin, disableBlending, draw, draw, draw, draw, enableBlending, end, flush, getBatchableCapacity, getBlendDstFunc, getBlendDstFuncAlpha, getBlendSrcFunc, getBlendSrcFuncAlpha, getProjectionMatrix, getRenderContext, getShader, getTransformMatrix, getVertexCapacity, isBlendingEnabled, isDrawing, repeatPreviousFlush, setBlendFunction, setBlendFunctionSeparate, setProjectionMatrix, setTransformMatrixclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbegin, disableBlending, enableBlending, end, flush, getBlendDstFunc, getBlendDstFuncAlpha, getBlendSrcFunc, getBlendSrcFuncAlpha, getProjectionMatrix, getShader, getTransformMatrix, isBlendingEnabled, isDrawing, setBlendFunction, setBlendFunctionSeparate, setProjectionMatrix, setTransformMatrixpublic CompliantBatch(java.lang.Class<T> batchableType, boolean supportPolygons)
setShader(ShaderProgram), the default can be used again by setting the shader to null.supportPolygons - Whether Poly2Ds are supported for drawing. The FlexBatch will not be optimized for
FixedSizeBatchables.public CompliantBatch(java.lang.Class<T> batchableType, int maxVertices, boolean supportPolygons)
setShader(ShaderProgram), the default can be used again by setting the shader to null.maxVertices - The number of vertices this FlexBatch can batch at once. Maximum of 32767.supportPolygons - Whether Poly2Ds are supported for drawing. The FlexBatch will not be optimized for
FixedSizeBatchables.public CompliantBatch(java.lang.Class<T> batchableType, int maxVertices, boolean generateDefaultShader, boolean supportPolygons)
maxVertices - The number of vertices this FlexBatch can batch at once. Maximum of 32767.generateDefaultShader - Whether a default shader should be created. The default shader is owned by the
CompliantQuadBatch, so it is disposed when the CompliantQuadBatch is disposed. If an alternate shader has been
applied with setShader(ShaderProgram), the default can be used again by setting the shader to null.supportPolygons - Whether Poly2Ds are supported for drawing. The FlexBatch will not be optimized for
FixedSizeBatchables.public void setShader(com.badlogic.gdx.graphics.glutils.ShaderProgram shader)
public void dispose()
public void setColor(com.badlogic.gdx.graphics.Color tint)
FlexBatch.draw(), FlexBatch.draw(Batchable), or draw(Texture, float[], int, int).setColor in interface com.badlogic.gdx.graphics.g2d.Batchpublic void setColor(float r,
float g,
float b,
float a)
FlexBatch.draw(), FlexBatch.draw(Batchable), or draw(Texture, float[], int, int).setColor in interface com.badlogic.gdx.graphics.g2d.Batchpublic void setColor(float color)
Color.WHITE.toFloatBits(). Does not affect the color of anything drawn with FlexBatch.draw(), FlexBatch.draw(Batchable), or
draw(Texture, float[], int, int).setColor in interface com.badlogic.gdx.graphics.g2d.Batchpublic com.badlogic.gdx.graphics.Color getColor()
getColor in interface com.badlogic.gdx.graphics.g2d.Batchpublic float getPackedColor()
getPackedColor in interface com.badlogic.gdx.graphics.g2d.Batchpublic void draw(com.badlogic.gdx.graphics.Texture texture,
float[] spriteVertices,
int offset,
int count)
draw in interface com.badlogic.gdx.graphics.g2d.Batchpublic void draw(com.badlogic.gdx.graphics.Texture texture,
float x,
float y,
float originX,
float originY,
float width,
float height,
float scaleX,
float scaleY,
float rotation,
int srcX,
int srcY,
int srcWidth,
int srcHeight,
boolean flipX,
boolean flipY)
draw in interface com.badlogic.gdx.graphics.g2d.Batchpublic void draw(com.badlogic.gdx.graphics.Texture texture,
float x,
float y,
float width,
float height,
int srcX,
int srcY,
int srcWidth,
int srcHeight,
boolean flipX,
boolean flipY)
draw in interface com.badlogic.gdx.graphics.g2d.Batchpublic void draw(com.badlogic.gdx.graphics.Texture texture,
float x,
float y,
int srcX,
int srcY,
int srcWidth,
int srcHeight)
draw in interface com.badlogic.gdx.graphics.g2d.Batchpublic void draw(com.badlogic.gdx.graphics.Texture texture,
float x,
float y,
float width,
float height,
float u,
float v,
float u2,
float v2)
draw in interface com.badlogic.gdx.graphics.g2d.Batchpublic void draw(com.badlogic.gdx.graphics.Texture texture,
float x,
float y)
draw in interface com.badlogic.gdx.graphics.g2d.Batchpublic void draw(com.badlogic.gdx.graphics.Texture texture,
float x,
float y,
float width,
float height)
draw in interface com.badlogic.gdx.graphics.g2d.Batchpublic void draw(com.badlogic.gdx.graphics.g2d.TextureRegion region,
float x,
float y)
draw in interface com.badlogic.gdx.graphics.g2d.Batchpublic void draw(com.badlogic.gdx.graphics.g2d.TextureRegion region,
float x,
float y,
float width,
float height)
draw in interface com.badlogic.gdx.graphics.g2d.Batchpublic void draw(com.badlogic.gdx.graphics.g2d.TextureRegion region,
float x,
float y,
float originX,
float originY,
float width,
float height,
float scaleX,
float scaleY,
float rotation)
draw in interface com.badlogic.gdx.graphics.g2d.Batchpublic void draw(com.badlogic.gdx.graphics.g2d.TextureRegion region,
float x,
float y,
float originX,
float originY,
float width,
float height,
float scaleX,
float scaleY,
float rotation,
boolean clockwise)
draw in interface com.badlogic.gdx.graphics.g2d.Batchpublic void draw(com.badlogic.gdx.graphics.g2d.TextureRegion region,
float width,
float height,
com.badlogic.gdx.math.Affine2 transform)
draw in interface com.badlogic.gdx.graphics.g2d.Batch