Class TextureAtlas.Sprite
- Enclosing class:
TextureAtlas
public static class TextureAtlas.Sprite
Represents a sprite in the texture atlas. This class contains properties such as name, position, dimensions, and rotation status of the sprite.
-
Method Summary
Modifier and TypeMethodDescriptionintGets the height of the sprite.getName()Gets the name of the sprite.intGets the x-offset of the sprite.intGets the y-offset of the sprite.intgetWidth()Gets the width of the sprite.intgetX()Gets the x-coordinate of the sprite.intgetY()Gets the y-coordinate of the sprite.booleanChecks if the sprite is rotated.voidsetHeight(int height) Sets the height of the sprite.voidSets the name of the sprite.voidsetOffsetX(int offsetX) Sets the x-offset of the sprite.voidsetOffsetY(int offsetY) Sets the y-offset of the sprite.voidsetRotated(boolean rotated) Sets the rotation status of the sprite.voidsetWidth(int width) Sets the width of the sprite.voidsetX(int x) Sets the x-coordinate of the sprite.voidsetY(int y) Sets the y-coordinate of the sprite.
-
Method Details
-
getName
-
getX
public int getX()Gets the x-coordinate of the sprite.- Returns:
- The x-coordinate of the sprite.
-
getY
public int getY()Gets the y-coordinate of the sprite.- Returns:
- The y-coordinate of the sprite.
-
getWidth
public int getWidth()Gets the width of the sprite.- Returns:
- The width of the sprite.
-
getHeight
public int getHeight()Gets the height of the sprite.- Returns:
- The height of the sprite.
-
getOffsetX
public int getOffsetX()Gets the x-offset of the sprite.- Returns:
- The x-offset of the sprite.
-
getOffsetY
public int getOffsetY()Gets the y-offset of the sprite.- Returns:
- The y-offset of the sprite.
-
isRotated
public boolean isRotated()Checks if the sprite is rotated.- Returns:
- True if the sprite is rotated, false otherwise.
-
setName
Sets the name of the sprite.- Parameters:
name- The new name to set.
-
setX
public void setX(int x) Sets the x-coordinate of the sprite.- Parameters:
x- The new x-coordinate to set.
-
setY
public void setY(int y) Sets the y-coordinate of the sprite.- Parameters:
y- The new y-coordinate to set.
-
setWidth
public void setWidth(int width) Sets the width of the sprite.- Parameters:
width- The new width to set.
-
setHeight
public void setHeight(int height) Sets the height of the sprite.- Parameters:
height- The new height to set.
-
setOffsetX
public void setOffsetX(int offsetX) Sets the x-offset of the sprite.- Parameters:
offsetX- The new x-offset to set.
-
setOffsetY
public void setOffsetY(int offsetY) Sets the y-offset of the sprite.- Parameters:
offsetY- The new y-offset to set.
-
setRotated
public void setRotated(boolean rotated) Sets the rotation status of the sprite.- Parameters:
rotated- The new rotation status to set.
-