com.badlogic.gdx.graphics.g2d
Class TextureAtlas.AtlasSprite

java.lang.Object
  extended by com.badlogic.gdx.graphics.g2d.TextureRegion
      extended by com.badlogic.gdx.graphics.g2d.Sprite
          extended by com.badlogic.gdx.graphics.g2d.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 Summary
TextureAtlas.AtlasSprite(TextureAtlas.AtlasRegion region)
           
TextureAtlas.AtlasSprite(TextureAtlas.AtlasSprite sprite)
           
 
Method Summary
 void flip(boolean x, boolean y)
          boolean parameters x,y are not setting a state, but performing a flip
 TextureAtlas.AtlasRegion getAtlasRegion()
           
 float getHeight()
           
 float getHeightRatio()
           
 float getOriginX()
          The origin influences Sprite.setPosition(float, float), Sprite.setRotation(float) and the expansion direction of scaling Sprite.setScale(float, float)
 float getOriginY()
          The origin influences Sprite.setPosition(float, float), Sprite.setRotation(float) and the expansion direction of scaling Sprite.setScale(float, float)
 float getWidth()
           
 float getWidthRatio()
           
 float getX()
           
 float getY()
           
 void rotate90(boolean clockwise)
          Rotates this sprite 90 degrees in-place by rotating the texture coordinates.
 void setBounds(float x, float y, float width, float height)
          Sets the position and size of the sprite when drawn, before scaling and rotation are applied.
 void setOrigin(float originX, float originY)
          Sets the origin in relation to the sprite's position for scaling and rotation.
 void setOriginCenter()
          Place origin in the center of the sprite
 void setPosition(float x, float y)
          Sets the position where the sprite will be drawn.
 void setSize(float width, float height)
          Sets the size of the sprite when drawn, before scaling and rotation are applied.
 void setX(float x)
          Sets the x position where the sprite will be drawn.
 void setY(float y)
          Sets the y position where the sprite will be drawn.
 
Methods inherited from class com.badlogic.gdx.graphics.g2d.Sprite
draw, draw, getBoundingRectangle, getColor, getRotation, getScaleX, getScaleY, getVertices, rotate, scale, scroll, set, setAlpha, setColor, setColor, setColor, setFlip, setRegion, setRotation, setScale, setScale, setU, setU2, setV, setV2, translate, translateX, translateY
 
Methods inherited from class com.badlogic.gdx.graphics.g2d.TextureRegion
getRegionHeight, getRegionWidth, getRegionX, getRegionY, getTexture, getU, getU2, getV, getV2, isFlipX, isFlipY, setRegion, setRegion, setRegion, setRegion, setRegionHeight, setRegionWidth, setRegionX, setRegionY, setTexture, split, split
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextureAtlas.AtlasSprite

public TextureAtlas.AtlasSprite(TextureAtlas.AtlasRegion region)

TextureAtlas.AtlasSprite

public TextureAtlas.AtlasSprite(TextureAtlas.AtlasSprite sprite)
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

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

getY

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


Copyright © 2014. All Rights Reserved.