Class Quad

All Implemented Interfaces:
Drawable, TransformDrawable

public final class Quad extends AbstractDrawable implements 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:
    • debugging

      public boolean debugging
    • 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, Color tint, float x, float y, float width, float height)
      Append all of the regions from another set
    • replaceRegionsColor

      public void replaceRegionsColor(Color from, Color to)
    • getRegions

      public Array<QuadRegion> getRegions()
    • multiplyRegionColors

      public Quad multiplyRegionColors(Color color)
    • 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.fasterxml.jackson.databind.node.ArrayNode jsonValue, AssetProvider<TextureRegion> regionProvider)
    • fromJson

      public static Quad fromJson(JsonValue jsonValue)
    • toJson5String

      public void toJson5String(StringBuilder sb)
    • toJson5StringWithIndent

      public void toJson5StringWithIndent(StringBuilder sb, int indent)
    • floatIsInt

      public static boolean floatIsInt(float value)
    • stripNonAscii

      public static String stripNonAscii(String str)
    • jsonWriteIntOrFloat

      public static void jsonWriteIntOrFloat(Json json, float value)
    • sbWriteIntOrFloat

      public static void sbWriteIntOrFloat(StringBuilder sb, float value)
    • intOrFloatString

      public static String intOrFloatString(float value)
    • toBytes

      public void toBytes(FixedOutput output)
    • fromByteArray

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

      public static Quad fromBytes(FixedInput input)
    • toBase64

      public String toBase64()
    • toJson

      public void toJson(Json json)
    • drawToCache

      public void drawToCache(SpriteCache spriteCache, float x, float y, float width, float height)
    • draw

      public void draw(Batch batch, float x, float y, float width, float height)
      Description copied from interface: 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 Drawable
    • draw

      public void draw(Batch batch, float x, float y, float width, float height, float scaleX, float scaleY, float rotation)
    • draw

      public void draw(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 TransformDrawable
    • drawDebug

      public void drawDebug(ShapeRenderer sRenderer, float x, float y, float originX, float originY, float width, float height, float scaleX, float scaleY, float rotation)