Class Batch

java.lang.Object
arc.graphics.g2d.Batch
All Implemented Interfaces:
Disposable
Direct Known Subclasses:
CacheBatch, PlaneBatch3D, SpriteBatch

public abstract class Batch extends Object implements Disposable
Base batch class. Provides a mesh, texture, shader, and other state.
  • Field Details

    • mesh

      protected Mesh mesh
    • z

      protected float z
    • sortAscending

      protected boolean sortAscending
    • idx

      protected int idx
    • lastTexture

      protected Texture lastTexture
    • apply

      protected boolean apply
    • transformMatrix

      protected final Mat transformMatrix
    • projectionMatrix

      protected final Mat projectionMatrix
    • combinedMatrix

      protected final Mat combinedMatrix
    • blending

      protected Blending blending
    • shader

      protected Shader shader
    • customShader

      protected Shader customShader
    • ownsShader

      protected boolean ownsShader
    • color

      protected final Color color
    • colorPacked

      protected float colorPacked
    • mixColor

      protected final Color 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

      protected void setColor(Color tint)
    • setColor

      protected void setColor(float r, float g, float b, float a)
    • getColor

      protected Color getColor()
    • setPackedColor

      protected void setPackedColor(float packedColor)
    • getPackedColor

      protected float getPackedColor()
    • setMixColor

      protected void setMixColor(Color tint)
    • setMixColor

      protected void setMixColor(float r, float g, float b, float a)
    • getMixColor

      protected Color getMixColor()
    • setPackedMixColor

      protected void setPackedMixColor(float packedColor)
    • getPackedMixColor

      protected float getPackedMixColor()
    • draw

      protected abstract void draw(Texture texture, float[] spriteVertices, int offset, int count)
    • draw

      protected abstract void draw(TextureRegion region, float x, float y, float originX, float originY, float width, float height, float rotation)
    • draw

      protected void draw(Runnable request)
    • flush

      protected abstract void flush()
    • setBlending

      protected void setBlending(Blending blending)
    • getBlending

      protected Blending getBlending()
    • dispose

      public void dispose()
      Description copied from interface: Disposable
      Releases all resources of this object.
      Specified by:
      dispose in interface Disposable
    • getProjection

      protected Mat getProjection()
    • getTransform

      protected Mat getTransform()
    • setProjection

      protected void setProjection(Mat projection)
    • setTransform

      protected void setTransform(Mat transform)
    • setupMatrices

      protected void setupMatrices()
    • switchTexture

      protected void switchTexture(Texture texture)
    • setShader

      protected void setShader(Shader shader)
    • setShader

      protected void setShader(Shader shader, boolean apply)
    • getShader

      protected Shader getShader()