public class Sprite
extends com.badlogic.gdx.graphics.g2d.Sprite
Sprite
to auto-flip
Texture
s due to mini2Dx placing its origin in the top-left
corner rather than the bottom-left corner like LibGDXConstructor and Description |
---|
Sprite()
Creates an uninitialized sprite.
|
Sprite(Sprite sprite)
Creates a sprite that is a copy in every way of the specified sprite.
|
Sprite(com.badlogic.gdx.graphics.Texture texture)
Creates a sprite with width, height, and texture region equal to the size
of the texture.
|
Sprite(com.badlogic.gdx.graphics.Texture texture,
int srcWidth,
int srcHeight)
Creates a sprite with width, height, and texture region equal to the
specified size.
|
Sprite(com.badlogic.gdx.graphics.Texture texture,
int srcX,
int srcY,
int srcWidth,
int srcHeight)
Creates a sprite with width, height, and texture region equal to the
specified size.
|
Sprite(TextureRegion region)
Creates a sprite based on a specific TextureRegion, the new sprite's
region is a copy of the parameter region - altering one does not affect
the other
|
Sprite(TextureRegion region,
int srcX,
int srcY,
int srcWidth,
int srcHeight)
Creates a sprite with width, height, and texture region equal to the
specified size, relative to specified sprite's texture region.
|
Modifier and Type | Method and Description |
---|---|
float |
getAlpha()
Returns the current alpha value of this Sprite
|
draw, draw, flip, getBoundingRectangle, getColor, getHeight, getOriginX, getOriginY, getRotation, getScaleX, getScaleY, getVertices, getWidth, getX, getY, rotate, rotate90, scale, scroll, set, setAlpha, setBounds, setCenter, setCenterX, setCenterY, setColor, setColor, setColor, setFlip, setOrigin, setOriginCenter, setPosition, setRegion, setRotation, setScale, setScale, setSize, setU, setU2, setV, setV2, setX, setY, translate, translateX, translateY
getRegionHeight, getRegionWidth, getRegionX, getRegionY, getTexture, getU, getU2, getV, getV2, isFlipX, isFlipY, setRegion, setRegion, setRegion, setRegion, setRegionHeight, setRegionWidth, setRegionX, setRegionY, setTexture, split, split
public Sprite()
public Sprite(com.badlogic.gdx.graphics.Texture texture)
public Sprite(com.badlogic.gdx.graphics.Texture texture, int srcWidth, int srcHeight)
srcWidth
- The width of the texture region. May be negative to flip the
sprite when drawn.srcHeight
- The height of the texture region. May be negative to flip the
sprite when drawn.public Sprite(com.badlogic.gdx.graphics.Texture texture, int srcX, int srcY, int srcWidth, int srcHeight)
srcX
- The x coordinate of the region to drawsrcY
- The y coordinate of the region to drawsrcWidth
- The width of the texture region. May be negative to flip the
sprite when drawn.srcHeight
- The height of the texture region. May be negative to flip the
sprite when drawn.public Sprite(TextureRegion region)
public Sprite(TextureRegion region, int srcX, int srcY, int srcWidth, int srcHeight)
srcX
- The x coordinate of the region to drawsrcY
- The y coordinate of the region to drawsrcWidth
- The width of the texture region. May be negative to flip the
sprite when drawn.srcHeight
- The height of the texture region. May be negative to flip the
sprite when drawn.public Sprite(Sprite sprite)