libgdx API

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)
           
 TextureAtlas.AtlasRegion getAtlasRegion()
           
 float getHeight()
           
 float getHeightRatio()
           
 float getOriginX()
           
 float getOriginY()
           
 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 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.
 
Methods inherited from class com.badlogic.gdx.graphics.g2d.Sprite
draw, draw, getBoundingRectangle, getColor, getRotation, getScaleX, getScaleY, getVertices, rotate, scale, scroll, set, setColor, setColor, setColor, setRegion, setRotation, setScale, setScale, setU, setU2, setV, setV2, setX, setY, 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
clone, equals, finalize, 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

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

flip

public void flip(boolean x,
                 boolean y)
Overrides:
flip in class Sprite

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()
Overrides:
getOriginX in class Sprite

getOriginY

public float getOriginY()
Overrides:
getOriginY in class Sprite

getWidth

public float getWidth()
Overrides:
getWidth in class Sprite

getHeight

public float getHeight()
Overrides:
getHeight in class Sprite

getWidthRatio

public float getWidthRatio()

getHeightRatio

public float getHeightRatio()

getAtlasRegion

public TextureAtlas.AtlasRegion getAtlasRegion()

libgdx API

Copyright 2010 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)