public interface TextureRegion
Modifier and Type | Method and Description |
---|---|
void |
flip(boolean x,
boolean y) |
int |
getRegionHeight()
Returns the region's height.
|
int |
getRegionWidth()
Returns the region's width.
|
int |
getRegionX() |
int |
getRegionY() |
Texture |
getTexture() |
float |
getU() |
float |
getU2() |
float |
getV() |
float |
getV2() |
boolean |
isFlipX() |
boolean |
isFlipY() |
void |
scroll(float xAmount,
float yAmount)
Offsets the region relative to the current region.
|
void |
setFlip(boolean flipX,
boolean flipY) |
void |
setFlipX(boolean flipX) |
void |
setFlipY(boolean flipY) |
void |
setRegion(float u,
float v,
float u2,
float v2) |
void |
setRegion(int x,
int y,
int width,
int height) |
void |
setRegion(Texture texture) |
void |
setRegion(TextureRegion region)
Sets the texture and coordinates to the specified region.
|
void |
setRegion(TextureRegion region,
int x,
int y,
int width,
int height)
Sets the texture to that of the specified region and sets the coordinates relative to the specified region.
|
void |
setRegionHeight(int height) |
void |
setRegionWidth(int width) |
void |
setRegionX(int x) |
void |
setRegionY(int y) |
void |
setTexture(Texture texture) |
void |
setU(float u) |
void |
setU2(float u2) |
void |
setV(float v) |
void |
setV2(float v2) |
TextureRegion[][] |
split(int tileWidth,
int tileHeight)
Helper function to create tiles out of this TextureRegion starting from the top left corner going to the right and ending at
the bottom right corner.
|
Pixmap |
toPixmap()
Converts this
TextureRegion to a Pixmap |
void setRegion(Texture texture)
void setRegion(int x, int y, int width, int height)
width
- The width of the texture region. May be negative to flip the sprite when drawn.height
- The height of the texture region. May be negative to flip the sprite when drawn.void setRegion(float u, float v, float u2, float v2)
void setRegion(TextureRegion region)
void setRegion(TextureRegion region, int x, int y, int width, int height)
Texture getTexture()
void setTexture(Texture texture)
float getU()
void setU(float u)
float getV()
void setV(float v)
float getU2()
void setU2(float u2)
float getV2()
void setV2(float v2)
int getRegionX()
void setRegionX(int x)
int getRegionY()
void setRegionY(int y)
int getRegionWidth()
void setRegionWidth(int width)
int getRegionHeight()
void setRegionHeight(int height)
void flip(boolean x, boolean y)
void setFlip(boolean flipX, boolean flipY)
boolean isFlipX()
void setFlipX(boolean flipX)
boolean isFlipY()
void setFlipY(boolean flipY)
void scroll(float xAmount, float yAmount)
xAmount
- The percentage to offset horizontally.yAmount
- The percentage to offset vertically. This is done in texture space, so up is negative.Pixmap toPixmap()
TextureRegion
to a Pixmap
Pixmap
instance containing the pixel dataTextureRegion[][] split(int tileWidth, int tileHeight)
tileWidth
- a tile's width in pixelstileHeight
- a tile's height in pixels