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.
    • Method Detail

      • 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
      • 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
      • 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
      • 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
      • getX

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

        public float getY()
        Overrides:
        getY 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()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object