Package com.prineside.tdi2.utils
Class Quad
java.lang.Object
com.prineside.tdi2.utils.AbstractDrawable
com.prineside.tdi2.utils.Quad
- All Implemented Interfaces:
Drawable
,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
-
Constructor Summary
ConstructorsConstructorDescriptionQuad
(float width, float height) Quad
(ResourcePack.AtlasTextureRegion textureRegion) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRegion
(QuadRegion region) void
Append all of the regions from another setvoid
Draws this drawable at the specified bounds.void
draw
(Batch batch, float x, float y, float width, float height, float scaleX, float scaleY, float rotation) void
draw
(Batch batch, float x, float y, float originX, float originY, float width, float height, float scaleX, float scaleY, float rotation) void
drawDebug
(ShapeRenderer sRenderer, float x, float y, float originX, float originY, float width, float height, float scaleX, float scaleY, float rotation) void
drawToCache
(SpriteCache spriteCache, float x, float y, float width, float height) static boolean
floatIsInt
(float value) static Quad
fromByteArray
(byte[] bytes) static Quad
fromBytes
(FixedInput input) static Quad
static Quad
fromJson
(com.fasterxml.jackson.databind.node.ArrayNode jsonValue, AssetProvider<TextureRegion> regionProvider) static Quad
fromString
(String str) float
static Quad
float
float
float
getWidth()
static String
intOrFloatString
(float value) static void
jsonWriteIntOrFloat
(Json json, float value) multiplyRegionColors
(Color color) void
replaceRegionsColor
(Color from, Color to) boolean
static void
sbWriteIntOrFloat
(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
void
void
toJson5StringWithIndent
(StringBuilder sb, int indent) Methods inherited from class com.prineside.tdi2.utils.AbstractDrawable
getBottomHeight, getLeftWidth, getMinHeight, getMinWidth, getRightWidth, getTopHeight, setBottomHeight, setLeftWidth, setMinHeight, setMinWidth, setRightWidth, setTopHeight
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.prineside.tdi2.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
Append all of the regions from another set -
replaceRegionsColor
-
getRegions
-
multiplyRegionColors
-
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<TextureRegion> regionProvider) -
fromJson
-
toJson5String
-
toJson5StringWithIndent
-
floatIsInt
public static boolean floatIsInt(float value) -
stripNonAscii
-
jsonWriteIntOrFloat
-
sbWriteIntOrFloat
-
intOrFloatString
-
toBytes
-
fromByteArray
-
fromBytes
-
toBase64
-
toJson
-
drawToCache
-
draw
Description copied from interface:Drawable
Draws this drawable at the specified bounds. The drawable should be tinted withBatch.getColor()
, possibly by mixing its own color. -
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 interfaceTransformDrawable
-
drawDebug
public void drawDebug(ShapeRenderer sRenderer, float x, float y, float originX, float originY, float width, float height, float scaleX, float scaleY, float rotation)
-