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 bytestatic final bytestatic final bytefinal float[]final QuadRegion.MetaDatastatic final byteFields 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 TypeMethodDescriptionvoiddraw(com.badlogic.gdx.graphics.g2d.Batch batch, float x, float y, float width, float height) Draw vertices at the specified xy with width,height.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 cos, float sin) static QuadRegionfromBytes(FixedInput input) static QuadRegionfromJson(com.badlogic.gdx.utils.JsonValue regionJson) bytecom.badlogic.gdx.graphics.Color[]float[]bytecom.badlogic.gdx.math.Rectanglecom.badlogic.gdx.graphics.g2d.TextureRegionbooleanbooleanbooleanvoidmultiplyCornerColors(com.badlogic.gdx.graphics.Color color) voidmultiplyCornerColors(com.badlogic.gdx.graphics.Color bl, com.badlogic.gdx.graphics.Color tl, com.badlogic.gdx.graphics.Color tr, com.badlogic.gdx.graphics.Color br) voidrotateAround(float x, float y, float angle) booleansameAs(QuadRegion region) voidset(QuadRegion region) voidsetColorMode(byte colorMode) voidsetCornerColors(com.badlogic.gdx.graphics.Color color) voidsetCornerColors(com.badlogic.gdx.graphics.Color[] colors) voidsetCornerColors(com.badlogic.gdx.graphics.Color bl, com.badlogic.gdx.graphics.Color tl, com.badlogic.gdx.graphics.Color tr, com.badlogic.gdx.graphics.Color br) voidsetCornerPositions(float[] v) voidsetCornerPositions(float aX, float aY, float bX, float bY, float cX, float cY, float dX, float dY) voidsetNinePathRegion(byte ninePathRegion) voidsetRegionName(String regionName) voidvoidsetVisible(boolean visible) voidShift the position if minX / minY is not zerovoidtoBytes(FixedOutput output) voidtoJson(com.badlogic.gdx.utils.Json json) voidtoJson(com.badlogic.gdx.utils.StringBuilder sb) Generates Json5voidtranslate(float x, float y) voidMethods 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
-
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:
drawin 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:
drawin 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)
-