Package com.prineside.tdi2.utils
Class QuadRegion
java.lang.Object
com.prineside.tdi2.utils.AbstractDrawable
com.prineside.tdi2.utils.QuadRegion
- All Implemented Interfaces:
com.badlogic.gdx.scenes.scene2d.utils.Drawable
,com.badlogic.gdx.scenes.scene2d.utils.TransformDrawable
public final class QuadRegion
extends AbstractDrawable
implements com.badlogic.gdx.scenes.scene2d.utils.TransformDrawable
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byte
static final byte
static final byte
final float[]
final QuadRegion.MetaData
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, com.badlogic.gdx.graphics.Color tint) QuadRegion
(QuadRegion from) -
Method Summary
Modifier and TypeMethodDescriptionvoid
draw
(com.badlogic.gdx.graphics.g2d.Batch batch, float x, float y, float width, float height) Draw vertices at the specified xy with width,height.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 cos, float sin) static QuadRegion
fromBytes
(FixedInput input) static QuadRegion
fromJson
(com.badlogic.gdx.utils.JsonValue regionJson) byte
com.badlogic.gdx.graphics.Color[]
float[]
byte
com.badlogic.gdx.math.Rectangle
com.badlogic.gdx.graphics.g2d.TextureRegion
boolean
boolean
boolean
void
multiplyCornerColors
(com.badlogic.gdx.graphics.Color color) void
multiplyCornerColors
(com.badlogic.gdx.graphics.Color bl, com.badlogic.gdx.graphics.Color tl, com.badlogic.gdx.graphics.Color tr, com.badlogic.gdx.graphics.Color br) void
rotateAround
(float x, float y, float angle) boolean
sameAs
(QuadRegion region) void
set
(QuadRegion region) void
setColorMode
(byte colorMode) void
setCornerColors
(com.badlogic.gdx.graphics.Color color) void
setCornerColors
(com.badlogic.gdx.graphics.Color[] colors) void
setCornerColors
(com.badlogic.gdx.graphics.Color bl, com.badlogic.gdx.graphics.Color tl, com.badlogic.gdx.graphics.Color tr, com.badlogic.gdx.graphics.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
setNinePathRegion
(byte ninePathRegion) void
setRegionName
(String regionName) void
void
setVisible
(boolean visible) void
Shift the position if minX / minY is not zerovoid
toBytes
(FixedOutput output) void
toJson
(com.badlogic.gdx.utils.Json json) void
toJson
(com.badlogic.gdx.utils.StringBuilder sb) 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.badlogic.gdx.scenes.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:
-
computedVertices
public final float[] computedVertices -
metaData
-
-
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, com.badlogic.gdx.graphics.Color tint)
-
-
Method Details
-
sameAs
-
getRegionName
-
isVisible
public boolean isVisible() -
setVisible
public void setVisible(boolean visible) -
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
-
set
-
getPosition
public com.badlogic.gdx.math.Rectangle getPosition() -
getCornerPositions
public float[] getCornerPositions() -
getCornerColors
public com.badlogic.gdx.graphics.Color[] getCornerColors() -
setCornerColors
public void setCornerColors(com.badlogic.gdx.graphics.Color bl, com.badlogic.gdx.graphics.Color tl, com.badlogic.gdx.graphics.Color tr, com.badlogic.gdx.graphics.Color br) -
setCornerColors
public void setCornerColors(com.badlogic.gdx.graphics.Color color) -
multiplyCornerColors
public void multiplyCornerColors(com.badlogic.gdx.graphics.Color bl, com.badlogic.gdx.graphics.Color tl, com.badlogic.gdx.graphics.Color tr, com.badlogic.gdx.graphics.Color br) -
multiplyCornerColors
public void multiplyCornerColors(com.badlogic.gdx.graphics.Color color) -
setCornerColors
public void setCornerColors(com.badlogic.gdx.graphics.Color[] colors) -
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
public com.badlogic.gdx.graphics.g2d.TextureRegion getTextureRegion() -
draw
public void draw(com.badlogic.gdx.graphics.g2d.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 interfacecom.badlogic.gdx.scenes.scene2d.utils.Drawable
-
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 originX, float originY, float width, float height, float scaleX, float scaleY, float rotation) - Specified by:
draw
in interfacecom.badlogic.gdx.scenes.scene2d.utils.TransformDrawable
-
rotateAround
public void rotateAround(float x, float y, float angle) -
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 cos, float sin) -
fromJson
-
isFullSizeRect
public boolean isFullSizeRect() -
hasSingleColor
public boolean hasSingleColor() -
toJson
public void toJson(com.badlogic.gdx.utils.StringBuilder sb) Generates Json5 -
toBytes
-
fromBytes
-
toJson
public void toJson(com.badlogic.gdx.utils.Json json)
-