com.badlogic.gdx.graphics.g2d
Class TextureAtlas.AtlasSprite
java.lang.Object
com.badlogic.gdx.graphics.g2d.TextureRegion
com.badlogic.gdx.graphics.g2d.Sprite
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.
Fields inherited from class com.badlogic.gdx.graphics.g2d.Sprite |
C1, C2, C3, C4, U1, U2, U3, U4, V1, V2, V3, V4, X1, X2, X3, X4, Y1, Y2, Y3, Y4 |
Method Summary |
void |
flip(boolean x,
boolean y)
|
TextureAtlas.AtlasRegion |
getAtlasRegion()
|
float |
getHeight()
|
float |
getOriginX()
|
float |
getOriginY()
|
float |
getWidth()
|
float |
getX()
|
float |
getY()
|
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, rotate90, scale, scroll, set, setColor, setColor, setRegion, setRotation, setScale, setScale, setU, setU2, setV, setV2, translate |
Methods inherited from class com.badlogic.gdx.graphics.g2d.TextureRegion |
getRegionHeight, getRegionWidth, getRegionX, getRegionY, getTexture, getU, getU2, getV, getV2, 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 |
TextureAtlas.AtlasSprite
public TextureAtlas.AtlasSprite(TextureAtlas.AtlasRegion region)
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
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
getAtlasRegion
public TextureAtlas.AtlasRegion getAtlasRegion()
Copyright 2010 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)