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
FieldsModifier and TypeFieldDescriptionstatic final float
static final float
boolean
static final FixedOutput
Fields 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, drawableParams
-
Constructor Summary
ConstructorsConstructorDescriptionQuad
(float width, float height) Quad
(ResourcePack.AtlasTextureRegion textureRegion) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRegion
(QuadRegion region) 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 setvoid
draw
(com.badlogic.gdx.graphics.g2d.Batch batch, float x, float y, float width, float height) Draws this drawable at the specified bounds.void
draw
(com.badlogic.gdx.graphics.g2d.Batch batch, float x, float y, float width, float height, float scaleX, float scaleY, float rotation) 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) void
draw
(com.badlogic.gdx.graphics.g2d.SpriteCache spriteCache, float x, float y, float width, float height) 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) static boolean
floatIsInt
(float value) static Quad
fromBytes
(byte[] bytes) static Quad
fromBytes
(FixedInput input) static Quad
fromJson
(com.badlogic.gdx.utils.JsonValue jsonValue) static Quad
fromJson
(com.fasterxml.jackson.databind.node.ArrayNode jsonValue, AssetProvider<com.badlogic.gdx.graphics.g2d.TextureRegion> regionProvider) static Quad
fromString
(String str) float
static Quad
float
float
com.badlogic.gdx.utils.Array<QuadRegion>
float
getWidth()
static String
intOrFloatString
(float value) static void
jsonWriteIntOrFloat
(com.badlogic.gdx.utils.Json json, float value) void
multiplyRegionColors
(com.badlogic.gdx.graphics.Color color) void
replaceRegionsColor
(com.badlogic.gdx.graphics.Color from, com.badlogic.gdx.graphics.Color to) boolean
static void
sbWriteIntOrFloat
(com.badlogic.gdx.utils.StringBuilder sb, float value) void
void
setHeight
(float h) void
setPivot
(float x, float y) void
setSize
(float width, float height) void
setWidth
(float w) static String
stripNonAscii
(String str) toBase64()
void
toBytes
(FixedOutput output) void
toJson
(com.badlogic.gdx.utils.Json json) void
toJson
(com.badlogic.gdx.utils.StringBuilder sb) void
toJson
(com.badlogic.gdx.utils.StringBuilder sb, int indent) Methods inherited from class com.prineside.tdi2.utils.AbstractDrawable
getBottomHeight, getLeftWidth, getMinHeight, getMinWidth, getRightWidth, getTopHeight, initializeDrawableParams, setBottomHeight, setLeftWidth, setMinHeight, setMinWidth, setRightWidth, setTopHeight
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
-
debugging
public boolean debugging -
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
-
multiplyRegionColors
public void multiplyRegionColors(com.badlogic.gdx.graphics.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
- Parameters:
str
- JSON or Base64 representation of the Quad
-
fromJson
public static Quad fromJson(com.fasterxml.jackson.databind.node.ArrayNode jsonValue, AssetProvider<com.badlogic.gdx.graphics.g2d.TextureRegion> regionProvider) -
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.Drawable
Draws this drawable at the specified bounds. The drawable should be tinted withBatch.getColor()
, possibly by mixing its own color.- Specified by:
draw
in 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:
draw
in 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)
-