Class TextureAtlas.AtlasSprite

Enclosing class:
TextureAtlas

public static class TextureAtlas.AtlasSprite extends Sprite
A sprite that, if whitespace was stripped from the region when it was packed, is automatically positioned as if whitespace had not been stripped.
  • Constructor Details

  • Method Details

    • setPosition

      public void setPosition(float x, float y)
      Description copied from class: Sprite
      Sets the position where the sprite will be drawn. If origin, rotation, or scale are changed, it is slightly more efficient to set the position after those operations. If both position and size are to be changed, it is better to use Sprite.setBounds(float, float, float, float).
      Overrides:
      setPosition in class Sprite
    • setBounds

      public void setBounds(float x, float y, float width, float height)
      Description copied from class: Sprite
      Sets the position and size of the sprite when drawn, before scaling and rotation are applied. If origin, rotation, or scale are changed, it is slightly more efficient to set the bounds after those operations.
      Overrides:
      setBounds in class Sprite
    • setSize

      public void setSize(float width, float height)
      Description copied from class: Sprite
      Sets the size of the sprite when drawn, before scaling and rotation are applied. If origin, rotation, or scale are changed, it is slightly more efficient to set the size after those operations. If both position and size are to be changed, it is better to use Sprite.setBounds(float, float, float, float).
      Overrides:
      setSize in class Sprite
    • setOrigin

      public void setOrigin(float originX, float originY)
      Description copied from class: Sprite
      Sets the origin in relation to the sprite's position for scaling and rotation.
      Overrides:
      setOrigin in class Sprite
    • setOriginCenter

      public void setOriginCenter()
      Description copied from class: Sprite
      Place origin in the center of the sprite
      Overrides:
      setOriginCenter in class Sprite
    • flip

      public void flip(boolean x, boolean y)
      Description copied from class: Sprite
      boolean parameters x,y are not setting a state, but performing a flip
      Overrides:
      flip in class Sprite
      Parameters:
      x - perform horizontal flip
      y - perform vertical flip
    • rotate90

      public void rotate90(boolean clockwise)
      Description copied from class: Sprite
      Rotates this sprite 90 degrees in-place by rotating the texture coordinates. This rotation is unaffected by Sprite.setRotation(float) and Sprite.rotate(float).
      Overrides:
      rotate90 in class Sprite
    • getX

      public float getX()
      Overrides:
      getX in class Sprite
    • setX

      public void setX(float x)
      Description copied from class: Sprite
      Sets the x position where the sprite will be drawn. If origin, rotation, or scale are changed, it is slightly more efficient to set the position after those operations. If both position and size are to be changed, it is better to use Sprite.setBounds(float, float, float, float).
      Overrides:
      setX in class Sprite
    • getY

      public float getY()
      Overrides:
      getY in class Sprite
    • setY

      public void setY(float y)
      Description copied from class: Sprite
      Sets the y position where the sprite will be drawn. If origin, rotation, or scale are changed, it is slightly more efficient to set the position after those operations. If both position and size are to be changed, it is better to use Sprite.setBounds(float, float, float, float).
      Overrides:
      setY in class Sprite
    • getOriginX

      public float getOriginX()
      Description copied from class: Sprite
      The origin influences Sprite.setPosition(float, float), Sprite.setRotation(float) and the expansion direction of scaling Sprite.setScale(float, float)
      Overrides:
      getOriginX in class Sprite
    • getOriginY

      public float getOriginY()
      Description copied from class: Sprite
      The origin influences Sprite.setPosition(float, float), Sprite.setRotation(float) and the expansion direction of scaling Sprite.setScale(float, float)
      Overrides:
      getOriginY in class Sprite
    • getWidth

      public float getWidth()
      Overrides:
      getWidth in class Sprite
      Returns:
      the width of the sprite, not accounting for scale.
    • getHeight

      public float getHeight()
      Overrides:
      getHeight in class Sprite
      Returns:
      the height of the sprite, not accounting for scale.
    • getWidthRatio

      public float getWidthRatio()
    • getHeightRatio

      public float getHeightRatio()
    • getAtlasRegion

      public TextureAtlas.AtlasRegion getAtlasRegion()
    • toString

      public String toString()
      Overrides:
      toString in class Object