public interface Sprite extends TextureRegion
Modifier and Type | Method and Description |
---|---|
float |
getAlpha() |
Rectangle |
getBoundingRectangle()
Returns the bounding axis aligned
Rectangle that bounds this sprite. |
float |
getHeight() |
float |
getOriginX()
The origin influences
setPosition(float, float) , setRotation(float) and the expansion direction of scaling
setScale(float, float) |
float |
getOriginY()
The origin influences
setPosition(float, float) , setRotation(float) and the expansion direction of scaling
setScale(float, float) |
float |
getRotation() |
float |
getScaleX()
X scale of the sprite, independent of size set by
setSize(float, float) |
float |
getScaleY()
Y scale of the sprite, independent of size set by
setSize(float, float) |
Color |
getTint()
Returns the color of this sprite.
|
float[] |
getVertices()
Returns the packed vertices, colors, and texture coordinates for this sprite.
|
float |
getWidth() |
float |
getX() |
float |
getY() |
void |
rotate(float degrees)
Sets the sprite's rotation in degrees relative to the current rotation.
|
void |
rotate90(boolean clockwise)
Rotates this sprite 90 degrees in-place by rotating the texture coordinates.
|
void |
scale(float amount)
Sets the sprite's scale relative to the current scale.
|
void |
set(Sprite sprite) |
void |
setAlpha(float a)
Sets the alpha portion of the color used to tint this sprite.
|
void |
setBounds(float x,
float y,
float width,
float height)
Sets the position and size of the sprite when drawn, before scaling and rotation are applied.
|
void |
setCenter(float x,
float y)
Sets the position so that the sprite is centered on (x, y)
|
void |
setCenterX(float x)
Sets the x position so that it is centered on the given x parameter
|
void |
setCenterY(float y)
Sets the y position so that it is centered on the given y parameter
|
void |
setFlip(boolean x,
boolean y)
Set the sprite's flip state regardless of current condition
|
void |
setFlipX(boolean flipX) |
void |
setFlipY(boolean flipY) |
void |
setOrigin(float originX,
float originY)
Sets the origin in relation to the sprite's position for scaling and rotation.
|
void |
setOriginBasedPosition(float x,
float y)
Sets the position where the sprite will be drawn, relative to its current origin.
|
void |
setOriginCenter()
Place origin in the center of the sprite
|
void |
setPosition(float x,
float y)
Sets the position where the sprite will be drawn.
|
void |
setRotation(float degrees)
Sets the rotation of the sprite in degrees.
|
void |
setScale(float scaleXY)
Sets the sprite's scale for both X and Y uniformly.
|
void |
setScale(float scaleX,
float scaleY)
Sets the sprite's scale for both X and Y.
|
void |
setSize(float width,
float height)
Sets the size of the sprite when drawn, before scaling and rotation are applied.
|
void |
setTint(Color tint)
Sets the color used to tint this sprite.
|
void |
setX(float x)
Sets the x position where the sprite will be drawn.
|
void |
setY(float y)
Sets the y position where the sprite will be drawn.
|
void |
translate(float xAmount,
float yAmount)
Sets the position relative to the current position where the sprite will be drawn.
|
void |
translateX(float xAmount)
Sets the x position relative to the current position where the sprite will be drawn.
|
void |
translateY(float yAmount)
Sets the y position relative to the current position where the sprite will be drawn.
|
flip, getRegionHeight, getRegionWidth, getRegionX, getRegionY, getTexture, getU, getU2, getV, getV2, isFlipX, isFlipY, scroll, setRegion, setRegion, setRegion, setRegion, setRegion, setRegionHeight, setRegionWidth, setRegionX, setRegionY, setTexture, setU, setU2, setV, setV2, split, toPixmap
void set(Sprite sprite)
void setBounds(float x, float y, float width, float height)
void setSize(float width, float height)
setBounds(float, float, float, float)
.void setPosition(float x, float y)
setBounds(float, float, float, float)
.void setOriginBasedPosition(float x, float y)
void setCenterX(float x)
void setCenterY(float y)
void setCenter(float x, float y)
void translateX(float xAmount)
void translateY(float yAmount)
void translate(float xAmount, float yAmount)
void setOrigin(float originX, float originY)
void setOriginCenter()
float getRotation()
void setRotation(float degrees)
setOrigin(float, float)
void rotate(float degrees)
setOrigin(float, float)
void rotate90(boolean clockwise)
setRotation(float)
and rotate(float)
.void setScale(float scaleXY)
getWidth()
and getHeight()
void setScale(float scaleX, float scaleY)
getWidth()
and getHeight()
void scale(float amount)
getWidth()
and
getHeight()
float[] getVertices()
Rectangle getBoundingRectangle()
Rectangle
that bounds this sprite. The rectangles x and y coordinates describe its
bottom left corner. If you change the position or size of the sprite, you have to fetch the triangle again for it to be
recomputed.float getX()
void setX(float x)
setBounds(float, float, float, float)
.float getY()
void setY(float y)
setBounds(float, float, float, float)
.float getWidth()
float getHeight()
float getOriginX()
setPosition(float, float)
, setRotation(float)
and the expansion direction of scaling
setScale(float, float)
float getOriginY()
setPosition(float, float)
, setRotation(float)
and the expansion direction of scaling
setScale(float, float)
float getScaleX()
setSize(float, float)
float getScaleY()
setSize(float, float)
Color getTint()
void setTint(Color tint)
void setFlip(boolean x, boolean y)
setFlip
in interface TextureRegion
x
- the desired horizontal flip statey
- the desired vertical flip statefloat getAlpha()
void setAlpha(float a)
void setFlipX(boolean flipX)
setFlipX
in interface TextureRegion
void setFlipY(boolean flipY)
setFlipY
in interface TextureRegion