public class LibgdxTextureRegion extends java.lang.Object implements TextureRegion
| Modifier and Type | Field and Description |
|---|---|
LibgdxTextureRegionWrapper |
textureRegion |
| Constructor and Description |
|---|
LibgdxTextureRegion(LibgdxTextureRegion textureRegion) |
LibgdxTextureRegion(LibgdxTextureRegion textureRegion,
int x,
int y,
int width,
int height) |
LibgdxTextureRegion(LibgdxTextureRegionWrapper 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 |
public final LibgdxTextureRegionWrapper textureRegion
public LibgdxTextureRegion(LibgdxTextureRegionWrapper textureRegion)
public LibgdxTextureRegion(LibgdxTextureRegion textureRegion)
public LibgdxTextureRegion(LibgdxTextureRegion textureRegion, int x, int y, int width, int height)
public void setRegion(Texture texture)
setRegion in interface TextureRegionpublic void setRegion(int x,
int y,
int width,
int height)
setRegion in interface TextureRegionwidth - 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.public void setRegion(float u,
float v,
float u2,
float v2)
setRegion in interface TextureRegionpublic void setRegion(TextureRegion region)
TextureRegionsetRegion in interface TextureRegionpublic void setRegion(TextureRegion region, int x, int y, int width, int height)
TextureRegionsetRegion in interface TextureRegionpublic Texture getTexture()
getTexture in interface TextureRegionpublic void setTexture(Texture texture)
setTexture in interface TextureRegionpublic float getU()
getU in interface TextureRegionpublic void setU(float u)
setU in interface TextureRegionpublic float getV()
getV in interface TextureRegionpublic void setV(float v)
setV in interface TextureRegionpublic float getU2()
getU2 in interface TextureRegionpublic void setU2(float u2)
setU2 in interface TextureRegionpublic float getV2()
getV2 in interface TextureRegionpublic void setV2(float v2)
setV2 in interface TextureRegionpublic int getRegionX()
getRegionX in interface TextureRegionpublic void setRegionX(int x)
setRegionX in interface TextureRegionpublic int getRegionY()
getRegionY in interface TextureRegionpublic void setRegionY(int y)
setRegionY in interface TextureRegionpublic int getRegionWidth()
TextureRegiongetRegionWidth in interface TextureRegionpublic void setRegionWidth(int width)
setRegionWidth in interface TextureRegionpublic int getRegionHeight()
TextureRegiongetRegionHeight in interface TextureRegionpublic void setRegionHeight(int height)
setRegionHeight in interface TextureRegionpublic void flip(boolean x,
boolean y)
flip in interface TextureRegionpublic void setFlip(boolean flipX,
boolean flipY)
setFlip in interface TextureRegionpublic boolean isFlipX()
isFlipX in interface TextureRegionpublic void setFlipX(boolean flipX)
setFlipX in interface TextureRegionpublic boolean isFlipY()
isFlipY in interface TextureRegionpublic void setFlipY(boolean flipY)
setFlipY in interface TextureRegionpublic void scroll(float xAmount,
float yAmount)
TextureRegionscroll in interface TextureRegionxAmount - The percentage to offset horizontally.yAmount - The percentage to offset vertically. This is done in texture space, so up is negative.public Pixmap toPixmap()
TextureRegionTextureRegion to a PixmaptoPixmap in interface TextureRegionPixmap instance containing the pixel datapublic TextureRegion[][] split(int tileWidth, int tileHeight)
TextureRegionsplit in interface TextureRegiontileWidth - a tile's width in pixelstileHeight - a tile's height in pixels