| Modifier and Type | Field and Description |
|---|---|
| pack-priv int | |
| pack-priv int | |
| pack-priv Texture | |
| pack-priv float | |
| pack-priv float | |
| pack-priv float | |
| pack-priv float |
| Access | Constructor and Description |
|---|---|
| public | TextureRegion()
Constructs a region that cannot be used until a texture and texture coordinates are set. |
| public | |
| public | TextureRegion(Texture texture, int
The width of the texture region. May be negative to flip the sprite when drawn. width, int The height of the texture region. May be negative to flip the sprite when drawn. height)
|
| public | TextureRegion(Texture texture, int x, int y, int
The width of the texture region. May be negative to flip the sprite when drawn. width, int The height of the texture region. May be negative to flip the sprite when drawn. height)
|
| public | |
| public | TextureRegion(TextureRegion region)
Constructs a region with the same texture and coordinates of the specified region. |
| public | TextureRegion(TextureRegion region, int x, int y, int
The width of the texture region. May be negative to flip the sprite when drawn. width, int The height of the texture region. May be negative to flip the sprite when drawn. height)Constructs a region with the same texture as the specified region and sets the coordinates relative to the specified region. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public int | |
| public int | |
| public int | |
| public int | |
| public Texture | |
| public float | |
| public float | |
| public float | |
| public float | |
| public boolean | |
| public boolean | |
| public void | scroll(float
The percentage to offset horizontally. xAmount, float The percentage to offset vertically. This is done in texture space, so up is negative. yAmount)Offsets the region relative to the current region. |
| public void | |
| public void | setRegion(int x, int y, int
The width of the texture region. May be negative to flip the sprite when drawn. width, int The height of the texture region. May be negative to flip the sprite when drawn. height)
|
| public void | |
| public void | |
| public 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. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public TextureRegion[][] | Returns: a 2D array of TextureRegions indexed by [row][column].a tile's width in pixels tileWidth, int a tile's height in pixels tileHeight)Helper method to create tiles out of this TextureRegion starting from the top left corner going to the right and ending at the bottom right corner. |
| public static TextureRegion[][] | Returns: a 2D array of TextureRegions indexed by [row][column].the Texture texture, int a tile's width in pixels tileWidth, int a tile's height in pixels tileHeight)Helper method to create tiles out of the given |
| regionHeight | back to summary |
|---|---|
| pack-priv int regionHeight | |
| regionWidth | back to summary |
|---|---|
| pack-priv int regionWidth | |
| texture | back to summary |
|---|---|
| pack-priv Texture texture | |
| u | back to summary |
|---|---|
| pack-priv float u | |
| u2 | back to summary |
|---|---|
| pack-priv float u2 | |
| v | back to summary |
|---|---|
| pack-priv float v | |
| v2 | back to summary |
|---|---|
| pack-priv float v2 | |
| TextureRegion | back to summary |
|---|---|
| public TextureRegion() Constructs a region that cannot be used until a texture and texture coordinates are set. | |
| TextureRegion | back to summary |
|---|---|
| public TextureRegion(Texture texture) Constructs a region the size of the specified texture. | |
| TextureRegion | back to summary |
|---|---|
public TextureRegion(Texture texture, int width, int height)
| |
| TextureRegion | back to summary |
|---|---|
public TextureRegion(Texture texture, int x, int y, int width, int height)
| |
| TextureRegion | back to summary |
|---|---|
| public TextureRegion(Texture texture, float u, float v, float u2, float v2) | |
| TextureRegion | back to summary |
|---|---|
| public TextureRegion(TextureRegion region) Constructs a region with the same texture and coordinates of the specified region. | |
| TextureRegion | back to summary |
|---|---|
| public TextureRegion(TextureRegion region, int x, int y, int width, int height) Constructs a region with the same texture as the specified region and sets the coordinates relative to the specified region.
| |
| flip | back to summary |
|---|---|
| public void flip(boolean x, boolean y) | |
| getRegionHeight | back to summary |
|---|---|
| public int getRegionHeight() Returns the region's height. | |
| getRegionWidth | back to summary |
|---|---|
| public int getRegionWidth() Returns the region's width. | |
| getRegionX | back to summary |
|---|---|
| public int getRegionX() | |
| getRegionY | back to summary |
|---|---|
| public int getRegionY() | |
| getTexture | back to summary |
|---|---|
| public Texture getTexture() | |
| getU | back to summary |
|---|---|
| public float getU() | |
| getU2 | back to summary |
|---|---|
| public float getU2() | |
| getV | back to summary |
|---|---|
| public float getV() | |
| getV2 | back to summary |
|---|---|
| public float getV2() | |
| isFlipX | back to summary |
|---|---|
| public boolean isFlipX() | |
| isFlipY | back to summary |
|---|---|
| public boolean isFlipY() | |
| scroll | back to summary |
|---|---|
| public void scroll(float xAmount, float yAmount) Offsets the region relative to the current region. Generally the region's size should be the entire size of the texture in the direction(s) it is scrolled.
| |
| setRegion | back to summary |
|---|---|
| public void setRegion(Texture texture) Sets the texture and sets the coordinates to the size of the specified texture. | |
| setRegion | back to summary |
|---|---|
public void setRegion(int x, int y, int width, int height)
| |
| setRegion | back to summary |
|---|---|
| public void setRegion(float u, float v, float u2, float v2) | |
| setRegion | back to summary |
|---|---|
| public void setRegion(TextureRegion region) Sets the texture and coordinates to the specified region. | |
| setRegion | back to summary |
|---|---|
| public 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. | |
| setRegionHeight | back to summary |
|---|---|
| public void setRegionHeight(int height) | |
| setRegionWidth | back to summary |
|---|---|
| public void setRegionWidth(int width) | |
| setRegionX | back to summary |
|---|---|
| public void setRegionX(int x) | |
| setRegionY | back to summary |
|---|---|
| public void setRegionY(int y) | |
| setTexture | back to summary |
|---|---|
| public void setTexture(Texture texture) | |
| setU | back to summary |
|---|---|
| public void setU(float u) | |
| setU2 | back to summary |
|---|---|
| public void setU2(float u2) | |
| setV | back to summary |
|---|---|
| public void setV(float v) | |
| setV2 | back to summary |
|---|---|
| public void setV2(float v2) | |
| split | back to summary |
|---|---|
| public TextureRegion[][] split(int tileWidth, int tileHeight) Helper method to create tiles out of this TextureRegion starting from the top left corner going to the right and ending at the bottom right corner. Only complete tiles will be returned so if the region's width or height are not a multiple of the tile width and height not all of the region will be used. This will not work on texture regions returned from a TextureAtlas that either have whitespace removed or where flipped before the region is split.
| |
| split | back to summary |
|---|---|
| public static TextureRegion[][] split(Texture texture, int tileWidth, int tileHeight) Helper method to create tiles out of the given
| |