Package arc.graphics.g2d
Class Batch
java.lang.Object
arc.graphics.g2d.Batch
- All Implemented Interfaces:
Disposable
- Direct Known Subclasses:
CacheBatch
,PlaneBatch3D
,SpriteBatch
Base batch class. Provides a mesh, texture, shader, and other state.
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
protected Blending
protected final Color
protected float
protected final Mat
protected Shader
protected int
protected Texture
protected Mesh
protected final Color
protected float
protected boolean
protected final Mat
protected Shader
protected boolean
protected final Mat
protected float
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Releases all resources of this object.protected abstract void
draw
(TextureRegion region, float x, float y, float originX, float originY, float width, float height, float rotation) protected abstract void
protected void
protected abstract void
flush()
protected Blending
protected Color
getColor()
protected Color
protected float
protected float
protected Mat
protected Shader
protected Mat
protected void
setBlending
(Blending blending) protected void
setColor
(float r, float g, float b, float a) protected void
protected void
setMixColor
(float r, float g, float b, float a) protected void
setMixColor
(Color tint) protected void
setPackedColor
(float packedColor) protected void
setPackedMixColor
(float packedColor) protected void
setProjection
(Mat projection) protected void
protected void
protected void
setSort
(boolean sort) Enables or disables Z-sorting.protected void
setSortAscending
(boolean ascend) Sets the sorting order.protected void
setTransform
(Mat transform) protected void
protected void
switchTexture
(Texture texture) protected void
z
(float z) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface arc.util.Disposable
isDisposed
-
Field Details
-
mesh
-
z
protected float z -
sortAscending
protected boolean sortAscending -
idx
protected int idx -
lastTexture
-
apply
protected boolean apply -
transformMatrix
-
projectionMatrix
-
combinedMatrix
-
blending
-
shader
-
customShader
-
ownsShader
protected boolean ownsShader -
color
-
colorPacked
protected float colorPacked -
mixColor
-
mixColorPacked
protected float mixColorPacked
-
-
Constructor Details
-
Batch
public Batch()
-
-
Method Details
-
z
protected void z(float z) -
setSort
protected void setSort(boolean sort) Enables or disables Z-sorting. Flushes the batch. Only does something on supported batches. -
setSortAscending
protected void setSortAscending(boolean ascend) Sets the sorting order. The batch must be flushed for this to take effect properly. -
setColor
-
setColor
protected void setColor(float r, float g, float b, float a) -
getColor
-
setPackedColor
protected void setPackedColor(float packedColor) -
getPackedColor
protected float getPackedColor() -
setMixColor
-
setMixColor
protected void setMixColor(float r, float g, float b, float a) -
getMixColor
-
setPackedMixColor
protected void setPackedMixColor(float packedColor) -
getPackedMixColor
protected float getPackedMixColor() -
draw
-
draw
protected abstract void draw(TextureRegion region, float x, float y, float originX, float originY, float width, float height, float rotation) -
draw
-
flush
protected abstract void flush() -
setBlending
-
getBlending
-
dispose
public void dispose()Description copied from interface:Disposable
Releases all resources of this object.- Specified by:
dispose
in interfaceDisposable
-
getProjection
-
getTransform
-
setProjection
-
setTransform
-
setupMatrices
protected void setupMatrices() -
switchTexture
-
setShader
-
setShader
-
getShader
-