Class Quad

All Implemented Interfaces:
com.badlogic.gdx.scenes.scene2d.utils.Drawable, com.badlogic.gdx.scenes.scene2d.utils.TransformDrawable

public final class Quad extends AbstractDrawable implements com.badlogic.gdx.scenes.scene2d.utils.TransformDrawable
  • Field Details

    • BINARY_FLOAT_PRECISION

      public static final float BINARY_FLOAT_PRECISION
      See Also:
    • BINARY_FLOAT_PRECISION_MUL

      public static final float BINARY_FLOAT_PRECISION_MUL
      See Also:
    • outputHelper

      public static final FixedOutput outputHelper
  • Constructor Details

    • Quad

      public Quad(float width, float height)
    • Quad

      public Quad(Quad from, boolean deepCopy)
      Parameters:
      deepCopy - create new copy of regions instead of sharing them
    • Quad

      public Quad(ResourcePack.AtlasTextureRegion textureRegion)
  • Method Details

    • getNoQuad

      public static Quad getNoQuad()
    • sameAs

      public boolean sameAs(Quad quad)
    • set

      public void set(Quad set, boolean deepCopy)
    • addRegion

      public void addRegion(QuadRegion region)
    • appendSet

      public void appendSet(Quad set, com.badlogic.gdx.graphics.Color tint, float x, float y, float width, float height)
      Append all of the regions from another set
    • replaceRegionsColor

      public void replaceRegionsColor(com.badlogic.gdx.graphics.Color from, com.badlogic.gdx.graphics.Color to)
    • getRegions

      public com.badlogic.gdx.utils.Array<QuadRegion> getRegions()
    • getWidth

      public float getWidth()
    • setWidth

      public void setWidth(float w)
    • getHeight

      public float getHeight()
    • setHeight

      public void setHeight(float h)
    • setPivot

      public void setPivot(float x, float y)
    • getPivotX

      public float getPivotX()
    • getPivotY

      public float getPivotY()
    • setSize

      public void setSize(float width, float height)
    • fromString

      public static Quad fromString(String str)
      Parameters:
      str - JSON or Base64 representation of the Quad
    • fromJson

      public static Quad fromJson(com.badlogic.gdx.utils.JsonValue jsonValue)
    • toJson

      public void toJson(com.badlogic.gdx.utils.StringBuilder sb)
    • toJson

      public void toJson(com.badlogic.gdx.utils.StringBuilder sb, int indent)
    • floatIsInt

      public static boolean floatIsInt(float value)
    • stripNonAscii

      public static String stripNonAscii(String str)
    • jsonWriteIntOrFloat

      public static void jsonWriteIntOrFloat(com.badlogic.gdx.utils.Json json, float value)
    • sbWriteIntOrFloat

      public static void sbWriteIntOrFloat(com.badlogic.gdx.utils.StringBuilder sb, float value)
    • intOrFloatString

      public static String intOrFloatString(float value)
    • toBytes

      public void toBytes(FixedOutput output)
    • fromBytes

      public static Quad fromBytes(byte[] bytes)
    • fromBytes

      public static Quad fromBytes(FixedInput input)
    • toBase64

      public String toBase64()
    • toJson

      public void toJson(com.badlogic.gdx.utils.Json json)
    • draw

      public void draw(com.badlogic.gdx.graphics.g2d.SpriteCache spriteCache, float x, float y, float width, float height)
    • draw

      public void draw(com.badlogic.gdx.graphics.g2d.Batch batch, float x, float y, float width, float height)
      Description copied from interface: com.badlogic.gdx.scenes.scene2d.utils.Drawable
      Draws this drawable at the specified bounds. The drawable should be tinted with Batch.getColor(), possibly by mixing its own color.
      Specified by:
      draw in interface com.badlogic.gdx.scenes.scene2d.utils.Drawable
    • draw

      public void draw(com.badlogic.gdx.graphics.g2d.Batch batch, float x, float y, float width, float height, float scaleX, float scaleY, float rotation)
    • draw

      public void draw(com.badlogic.gdx.graphics.g2d.Batch batch, float x, float y, float originX, float originY, float width, float height, float scaleX, float scaleY, float rotation)
      Specified by:
      draw in interface com.badlogic.gdx.scenes.scene2d.utils.TransformDrawable
    • drawDebug

      public void drawDebug(com.badlogic.gdx.graphics.glutils.ShapeRenderer sRenderer, float x, float y, float originX, float originY, float width, float height, float scaleX, float scaleY, float rotation)