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 TextureRegion
public void setRegion(int x, int y, int width, int height)
setRegion
in interface TextureRegion
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.public void setRegion(float u, float v, float u2, float v2)
setRegion
in interface TextureRegion
public void setRegion(TextureRegion region)
TextureRegion
setRegion
in interface TextureRegion
public void setRegion(TextureRegion region, int x, int y, int width, int height)
TextureRegion
setRegion
in interface TextureRegion
public Texture getTexture()
getTexture
in interface TextureRegion
public void setTexture(Texture texture)
setTexture
in interface TextureRegion
public float getU()
getU
in interface TextureRegion
public void setU(float u)
setU
in interface TextureRegion
public float getV()
getV
in interface TextureRegion
public void setV(float v)
setV
in interface TextureRegion
public float getU2()
getU2
in interface TextureRegion
public void setU2(float u2)
setU2
in interface TextureRegion
public float getV2()
getV2
in interface TextureRegion
public void setV2(float v2)
setV2
in interface TextureRegion
public int getRegionX()
getRegionX
in interface TextureRegion
public void setRegionX(int x)
setRegionX
in interface TextureRegion
public int getRegionY()
getRegionY
in interface TextureRegion
public void setRegionY(int y)
setRegionY
in interface TextureRegion
public int getRegionWidth()
TextureRegion
getRegionWidth
in interface TextureRegion
public void setRegionWidth(int width)
setRegionWidth
in interface TextureRegion
public int getRegionHeight()
TextureRegion
getRegionHeight
in interface TextureRegion
public void setRegionHeight(int height)
setRegionHeight
in interface TextureRegion
public void flip(boolean x, boolean y)
flip
in interface TextureRegion
public void setFlip(boolean flipX, boolean flipY)
setFlip
in interface TextureRegion
public boolean isFlipX()
isFlipX
in interface TextureRegion
public void setFlipX(boolean flipX)
setFlipX
in interface TextureRegion
public boolean isFlipY()
isFlipY
in interface TextureRegion
public void setFlipY(boolean flipY)
setFlipY
in interface TextureRegion
public void scroll(float xAmount, float yAmount)
TextureRegion
scroll
in interface TextureRegion
xAmount
- The percentage to offset horizontally.yAmount
- The percentage to offset vertically. This is done in texture space, so up is negative.public Pixmap toPixmap()
TextureRegion
TextureRegion
to a Pixmap
toPixmap
in interface TextureRegion
Pixmap
instance containing the pixel datapublic TextureRegion[][] split(int tileWidth, int tileHeight)
TextureRegion
split
in interface TextureRegion
tileWidth
- a tile's width in pixelstileHeight
- a tile's height in pixels