Class QuadRegion

java.lang.Object
com.prineside.tdi2.utils.AbstractDrawable
com.prineside.tdi2.utils.QuadRegion
All Implemented Interfaces:
Drawable, TransformDrawable

public final class QuadRegion extends AbstractDrawable implements TransformDrawable
  • Field Details

  • Constructor Details

  • Method Details

    • sameAs

      public boolean sameAs(QuadRegion region)
    • getRegionName

      @Null public String getRegionName()
    • getQuadName

      @Null public String getQuadName()
    • isDebugging

      public boolean isDebugging()
    • isSingleColor

      public boolean isSingleColor()
    • isVisible

      public boolean isVisible()
    • setVisible

      public void setVisible(boolean visible)
    • setDebugging

      public void setDebugging(boolean debugging)
    • getNinePathRegion

      public byte getNinePathRegion()
    • setNinePathRegion

      public void setNinePathRegion(byte ninePathRegion)
    • getColorMode

      public byte getColorMode()
    • setColorMode

      public void setColorMode(byte colorMode)
    • setRegionName

      public void setRegionName(@Null String regionName)
      Parameters:
      regionName - may be null to set blank. Will set from a default provider of TextureRegion. If region is not found, name will be preserved but actual region will be set to blank
    • setRegionNameFromProvider

      public void setRegionNameFromProvider(String regionName, AssetProvider<TextureRegion> regionProvider)
    • setPosition

      public void setPosition(float x, float y)
    • set

      public void set(QuadRegion region)
    • getX

      public float getX()
    • getY

      public float getY()
    • getWidth

      public float getWidth()
    • getHeight

      public float getHeight()
    • getCornerPositions

      public float[] getCornerPositions()
    • getCornerColors

      public QuadRegion.CornerColors getCornerColors()
    • setCornerColorsSeparate

      public void setCornerColorsSeparate(Color bl, Color tl, Color tr, Color br)
    • setSameCornerColors

      public void setSameCornerColors(Color color)
    • multiplyCornerColors

      public void multiplyCornerColors(Color color)
    • setCornerColorsObject

      public void setCornerColorsObject(QuadRegion.CornerColors cornerColors)
    • setCornerPositions

      public void setCornerPositions(float aX, float aY, float bX, float bY, float cX, float cY, float dX, float dY)
    • setCornerPositions

      public void setCornerPositions(float[] v)
    • shiftPositionToMatchCorners

      public void shiftPositionToMatchCorners()
      Shift the position if minX / minY is not zero
    • translate

      public void translate(float x, float y)
    • setTextureRegion

      public void setTextureRegion(ResourcePack.AtlasTextureRegion region)
    • updateSize

      public void updateSize()
    • getTextureRegion

      public TextureRegion getTextureRegion()
    • draw

      public void draw(Batch batch, float x, float y, float width, float height)
      Draw vertices at the specified xy with width,height. Position rect of the region is ignored
      Specified by:
      draw in interface Drawable
    • 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 originX, float originY, float width, float height, float scaleX, float scaleY, float rotation)
      Specified by:
      draw in interface TransformDrawable
    • rotateAround

      public void rotateAround(float x, float y, float angle)
    • drawDebug

      public void drawDebug(ShapeRenderer sRenderer, float x, float y, float originX, float originY, float width, float height, float scaleX, float scaleY, float cos, float sin)
    • fromJson

      public static QuadRegion fromJson(com.fasterxml.jackson.databind.JsonNode regionJson, AssetProvider<TextureRegion> regionProvider)
    • fromJson

      public static QuadRegion fromJson(JsonValue regionJson)
    • isFullSizeRect

      public boolean isFullSizeRect()
    • toJson5String

      public void toJson5String(StringBuilder sb)
      Generates Json5
    • toBytes

      public void toBytes(FixedOutput output)
    • fromBytes

      public static QuadRegion fromBytes(FixedInput input)
    • toJson

      public void toJson(Json json)