Package com.prineside.tdi2.utils
Class QuadRegion
java.lang.Object
com.prineside.tdi2.utils.AbstractDrawable
com.prineside.tdi2.utils.QuadRegion
- All Implemented Interfaces:
Drawable
,TransformDrawable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
static interface
static final class
static final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byte
static final byte
static final byte
static final byte
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
ConstructorsConstructorDescriptionQuadRegion
(float[] positions, float x, float y) QuadRegion
(ResourcePack.AtlasTextureRegion region, float x, float y, float width, float height) QuadRegion
(ResourcePack.AtlasTextureRegion region, float x, float y, float width, float height, Color tint) QuadRegion
(QuadRegion from) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Draw vertices at the specified xy with width,height.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 cos, float sin) void
drawToCache
(SpriteCache spriteCache, float x, float y, float width, float height) static QuadRegion
fromBytes
(FixedInput input) static QuadRegion
static QuadRegion
fromJson
(com.fasterxml.jackson.databind.JsonNode regionJson, AssetProvider<TextureRegion> regionProvider) byte
float[]
float
byte
float
getWidth()
float
getX()
float
getY()
boolean
boolean
boolean
boolean
void
multiplyCornerColors
(Color color) void
rotateAround
(float x, float y, float angle) boolean
sameAs
(QuadRegion region) void
set
(QuadRegion region) void
setColorMode
(byte colorMode) void
setCornerColorsObject
(QuadRegion.CornerColors cornerColors) void
setCornerColorsSeparate
(Color bl, Color tl, Color tr, Color br) void
setCornerPositions
(float[] v) void
setCornerPositions
(float aX, float aY, float bX, float bY, float cX, float cY, float dX, float dY) void
setDebugging
(boolean debugging) void
setNinePathRegion
(byte ninePathRegion) void
setPosition
(float x, float y) void
setRegionName
(String regionName) void
setRegionNameFromProvider
(String regionName, AssetProvider<TextureRegion> regionProvider) void
setSameCornerColors
(Color color) void
void
setVisible
(boolean visible) void
Shift the position if minX / minY is not zerovoid
toBytes
(FixedOutput output) void
void
Generates Json5void
translate
(float x, float y) void
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
-
NINE_PATH_NONE
public static final byte NINE_PATH_NONE- See Also:
-
COLOR_MODE_INHERIT
public static final byte COLOR_MODE_INHERIT- See Also:
-
COLOR_MODE_STATIC_RGB
public static final byte COLOR_MODE_STATIC_RGB- See Also:
-
COLOR_MODE_STATIC_RGBA
public static final byte COLOR_MODE_STATIC_RGBA- See Also:
-
regionName
-
quadName
-
-
Constructor Details
-
QuadRegion
-
QuadRegion
public QuadRegion(float[] positions, float x, float y) -
QuadRegion
public QuadRegion(ResourcePack.AtlasTextureRegion region, float x, float y, float width, float height) -
QuadRegion
public QuadRegion(ResourcePack.AtlasTextureRegion region, float x, float y, float width, float height, Color tint)
-
-
Method Details
-
sameAs
-
getRegionName
-
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
- 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
-
getX
public float getX() -
getY
public float getY() -
getWidth
public float getWidth() -
getHeight
public float getHeight() -
getCornerPositions
public float[] getCornerPositions() -
getCornerColors
-
setCornerColorsSeparate
-
setSameCornerColors
-
multiplyCornerColors
-
setCornerColorsObject
-
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
-
updateSize
public void updateSize() -
getTextureRegion
-
draw
Draw vertices at the specified xy with width,height. Position rect of the region is ignored -
drawToCache
-
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
-
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
-
isFullSizeRect
public boolean isFullSizeRect() -
toJson5String
Generates Json5 -
toBytes
-
fromBytes
-
toJson
-