Package com.prineside.tdi2.utils
Class Quad
java.lang.Object
com.prineside.tdi2.utils.AbstractDrawable
com.prineside.tdi2.utils.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 Summary
FieldsFields inherited from class com.prineside.tdi2.utils.AbstractDrawable
DRAWABLE_PARAM_BOTTOM_HEIGHT, DRAWABLE_PARAM_LEFT_WIDTH, DRAWABLE_PARAM_MIN_HEIGHT, DRAWABLE_PARAM_MIN_WIDTH, DRAWABLE_PARAM_RIGHT_WIDTH, DRAWABLE_PARAM_TOP_HEIGHT -
Constructor Summary
ConstructorsConstructorDescriptionQuad(float width, float height) Quad(ResourcePack.AtlasTextureRegion textureRegion) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRegion(QuadRegion region) voidappendSet(Quad set, com.badlogic.gdx.graphics.Color tint, float x, float y, float width, float height) Append all of the regions from another setvoiddraw(com.badlogic.gdx.graphics.g2d.Batch batch, float x, float y, float width, float height) Draws this drawable at the specified bounds.voiddraw(com.badlogic.gdx.graphics.g2d.Batch batch, float x, float y, float width, float height, float scaleX, float scaleY, float rotation) voiddraw(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) voiddraw(com.badlogic.gdx.graphics.g2d.SpriteCache spriteCache, float x, float y, float width, float height) voiddrawDebug(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) static booleanfloatIsInt(float value) static QuadfromBytes(byte[] bytes) static QuadfromBytes(FixedInput input) static QuadfromJson(com.badlogic.gdx.utils.JsonValue jsonValue) static QuadfromString(String str) floatstatic Quadfloatfloatcom.badlogic.gdx.utils.Array<QuadRegion>floatgetWidth()static StringintOrFloatString(float value) static voidjsonWriteIntOrFloat(com.badlogic.gdx.utils.Json json, float value) voidreplaceRegionsColor(com.badlogic.gdx.graphics.Color from, com.badlogic.gdx.graphics.Color to) booleanstatic voidsbWriteIntOrFloat(com.badlogic.gdx.utils.StringBuilder sb, float value) voidvoidsetHeight(float h) voidsetPivot(float x, float y) voidsetSize(float width, float height) voidsetWidth(float w) static StringstripNonAscii(String str) toBase64()voidtoBytes(FixedOutput output) voidtoJson(com.badlogic.gdx.utils.Json json) voidtoJson(com.badlogic.gdx.utils.StringBuilder sb) voidtoJson(com.badlogic.gdx.utils.StringBuilder sb, int indent) Methods inherited from class com.prineside.tdi2.utils.AbstractDrawable
getBottomHeight, getLeftWidth, getMinHeight, getMinWidth, getRightWidth, getTopHeight, setBottomHeight, setLeftWidth, setMinHeight, setMinWidth, setRightWidth, setTopHeightMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.badlogic.gdx.scenes.scene2d.utils.Drawable
getBottomHeight, getLeftWidth, getMinHeight, getMinWidth, getRightWidth, getTopHeight, setBottomHeight, setLeftWidth, setMinHeight, setMinWidth, setRightWidth, setTopHeight
-
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
-
-
Constructor Details
-
Quad
public Quad(float width, float height) -
Quad
- Parameters:
deepCopy- create new copy of regions instead of sharing them
-
Quad
-
-
Method Details
-
getNoQuad
-
sameAs
-
set
-
addRegion
-
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
-
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
- Parameters:
str- JSON or Base64 representation of the Quad
-
fromJson
-
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
-
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
-
toBytes
-
fromBytes
-
fromBytes
-
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.DrawableDraws this drawable at the specified bounds. The drawable should be tinted withBatch.getColor(), possibly by mixing its own color.- Specified by:
drawin interfacecom.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:
drawin interfacecom.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)
-