Batchable.FixedSizeBatchable| Modifier and Type | Field and Description |
|---|---|
float |
color |
protected float |
height
Width and height must be set with
size(float, float). |
protected int |
numIndices |
protected int |
numVertices |
float |
originX |
float |
originY |
protected com.badlogic.gdx.graphics.g2d.PolygonRegion |
region |
float |
scaleX |
float |
scaleY |
protected boolean |
sizeSet
Whether the width and height have been set since the last call to
refresh(). |
protected static float |
WHITE |
protected float |
width
Width and height must be set with
size(float, float). |
float |
x |
float |
y |
| Constructor and Description |
|---|
Poly() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addVertexAttributes(com.badlogic.gdx.utils.Array<com.badlogic.gdx.graphics.VertexAttribute> attributes)
A Batchable implementation calls this to populate a list of vertex attributes that will be used by the FlexBatch.
|
protected int |
apply(float[] vertices,
int vertexStartingIndex,
AttributeOffsets offsets,
int vertexSize)
Called by FlexBatch.
|
protected int |
apply(short[] triangles,
int triangleStartingIndex,
short firstVertex)
Called by FlexBatch.
|
Poly |
color(com.badlogic.gdx.graphics.Color color) |
Poly |
color(float floatBits) |
Poly |
color(float r,
float g,
float b,
float a) |
protected int |
getNumberOfTextures() |
protected abstract boolean |
isPosition3D()
Determines whether the position data has a Z component.
|
protected abstract boolean |
isTextureCoordinate3D()
Determines whether the texture coordinate data has a third component (for TextureArray layers).
|
Poly |
origin(float originX,
float originY)
Sets the center point for transformations (rotation and scale).
|
protected boolean |
prepareContext(RenderContextAccumulator renderContext,
int remainingVertices,
int remainingIndices)
Called before
Batchable.apply(float[], int, AttributeOffsets, int) to set render context states and texture bindings, and to
determine if a flush is necessary before this Batchable can be drawn. |
void |
refresh()
Resets the state and default parameters of the Batchable so it can be reused for an entirely new image.
|
Poly |
region(com.badlogic.gdx.graphics.g2d.PolygonRegion region)
Sets the polygon region.
|
void |
reset()
Resets the state of the object and drops Texture references to prepare it for returning to a
Pool. |
Poly |
scale(float scaleX,
float scaleY) |
Poly |
size(float width,
float height) |
prepareSharedContextprotected com.badlogic.gdx.graphics.g2d.PolygonRegion region
protected int numVertices
protected int numIndices
public float x
public float y
public float color
public float originX
public float originY
public float scaleX
public float scaleY
protected float width
size(float, float). If they are not set, they default to the size of the first
texture region.protected float height
size(float, float). If they are not set, they default to the size of the first
texture region.protected boolean sizeSet
refresh(). If they have not been set, they will
be set to match the size of the polygon region when drawing occurs.protected static final float WHITE
protected void addVertexAttributes(com.badlogic.gdx.utils.Array<com.badlogic.gdx.graphics.VertexAttribute> attributes)
BatchableaddVertexAttributes in class Batchableattributes - An array to which attributes can be added.protected final int getNumberOfTextures()
getNumberOfTextures in class Batchableprotected abstract boolean isPosition3D()
Overriding this method will produce a subclass that is incompatible with a FlexBatch that was instantiated for the superclass type.
protected abstract boolean isTextureCoordinate3D()
Overriding this method will produce a subclass that is incompatible with a FlexBatch that was instantiated for the superclass type.
protected boolean prepareContext(RenderContextAccumulator renderContext, int remainingVertices, int remainingIndices)
BatchableBatchable.apply(float[], int, AttributeOffsets, int) to set render context states and texture bindings, and to
determine if a flush is necessary before this Batchable can be drawn.
Overriding this method may produce a subclass that is incompatible with a FlexBatch that was instantiated for the superclass
type.prepareContext in class BatchablerenderContext - The FlexBatch's manager of GL state changes and texture bindings. Pending state changes and texture
bindings can be made on this context, and the context will return whether the context is now changed, which means
a flush is required and this method needs to return true.remainingVertices - The number of vertices that can be drawn before the next flush is required.remainingIndices - The number of triangle indices that can be drawn before the next flush is required. This value is
undefined for Batchable.FixedSizeBatchable and should not be used or checked against.public void refresh()
Batchablepublic void reset()
Pool.reset in interface com.badlogic.gdx.utils.Pool.Poolablepublic Poly region(com.badlogic.gdx.graphics.g2d.PolygonRegion region)
public Poly size(float width, float height)
public Poly origin(float originX, float originY)
Quad2D, this is relative to the bottom left
corner of the texture region. For Quad3D, this is relative to the center of the texture region and is in the local
coordinate system.public Poly color(com.badlogic.gdx.graphics.Color color)
public Poly color(float r, float g, float b, float a)
public Poly color(float floatBits)
public Poly scale(float scaleX, float scaleY)
protected int apply(float[] vertices,
int vertexStartingIndex,
AttributeOffsets offsets,
int vertexSize)
Batchableapply in class Batchableoffsets - The offsets of the vertex attributes.vertexSize - The size of a vertex in floats.Batchable.FixedSizeBatchable, as it is
assumed to match Batchable.FixedSizeBatchable.getVerticesPerBatchable().protected int apply(short[] triangles,
int triangleStartingIndex,
short firstVertex)
BatchableFixedSizeBatchables.
Overriding this method may produce a subclass that is incompatible with a FlexBatch that was instantiated for the superclass
type.