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 Type
    Method
    Description
    int
    Gets the height of the sprite.
    Gets the name of the sprite.
    int
    Gets the x-offset of the sprite.
    int
    Gets the y-offset of the sprite.
    int
    Gets the width of the sprite.
    int
    Gets the x-coordinate of the sprite.
    int
    Gets the y-coordinate of the sprite.
    boolean
    Checks if the sprite is rotated.
    void
    setHeight(int height)
    Sets the height of the sprite.
    void
    Sets the name of the sprite.
    void
    setOffsetX(int offsetX)
    Sets the x-offset of the sprite.
    void
    setOffsetY(int offsetY)
    Sets the y-offset of the sprite.
    void
    setRotated(boolean rotated)
    Sets the rotation status of the sprite.
    void
    setWidth(int width)
    Sets the width of the sprite.
    void
    setX(int x)
    Sets the x-coordinate of the sprite.
    void
    setY(int y)
    Sets the y-coordinate of the sprite.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getName

      public String getName()
      Gets the name of the sprite.
      Returns:
      The name of the sprite.
    • 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

      public void setName(String name)
      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.