Package gaiasky.util.gdx.g2d
Class TextureAtlas.AtlasSprite
- java.lang.Object
-
- gaiasky.util.gdx.g2d.TextureRegion
-
- gaiasky.util.gdx.g2d.Sprite
-
- gaiasky.util.gdx.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
Constructors Constructor Description AtlasSprite(TextureAtlas.AtlasRegion region)AtlasSprite(TextureAtlas.AtlasSprite sprite)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidflip(boolean x, boolean y)boolean parameters x,y are not setting a state, but performing a flipTextureAtlas.AtlasRegiongetAtlasRegion()floatgetHeight()floatgetHeightRatio()floatgetOriginX()The origin influencesSprite.setPosition(float, float),Sprite.setRotation(float)and the expansion direction of scalingSprite.setScale(float, float)floatgetOriginY()The origin influencesSprite.setPosition(float, float),Sprite.setRotation(float)and the expansion direction of scalingSprite.setScale(float, float)floatgetWidth()floatgetWidthRatio()floatgetX()floatgetY()voidrotate90(boolean clockwise)Rotates this sprite 90 degrees in-place by rotating the texture coordinates.voidsetBounds(float x, float y, float width, float height)Sets the position and size of the sprite when drawn, before scaling and rotation are applied.voidsetOrigin(float originX, float originY)Sets the origin in relation to the sprite's position for scaling and rotation.voidsetOriginCenter()Place origin in the center of the spritevoidsetPosition(float x, float y)Sets the position where the sprite will be drawn.voidsetSize(float width, float height)Sets the size of the sprite when drawn, before scaling and rotation are applied.voidsetX(float x)Sets the x position where the sprite will be drawn.voidsetY(float y)Sets the y position where the sprite will be drawn.java.lang.StringtoString()-
Methods inherited from class gaiasky.util.gdx.g2d.Sprite
draw, draw, getBoundingRectangle, getColor, getRotation, getScaleX, getScaleY, getVertices, rotate, scale, scroll, set, setAlpha, setCenter, setCenterX, setCenterY, setColor, setColor, setFlip, setOriginBasedPosition, setPackedColor, setRegion, setRotation, setScale, setScale, setU, setU2, setV, setV2, translate, translateX, translateY
-
Methods inherited from class gaiasky.util.gdx.g2d.TextureRegion
getRegionHeight, getRegionWidth, getRegionX, getRegionY, getTexture, getU, getU2, getV, getV2, isFlipX, isFlipY, setRegion, setRegion, setRegion, setRegion, setRegionHeight, setRegionWidth, setRegionX, setRegionY, setTexture, split, split
-
-
-
-
Constructor Detail
-
AtlasSprite
public AtlasSprite(TextureAtlas.AtlasRegion region)
-
AtlasSprite
public AtlasSprite(TextureAtlas.AtlasSprite sprite)
-
-
Method Detail
-
setPosition
public void setPosition(float x, float y)Description copied from class:SpriteSets 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 useSprite.setBounds(float, float, float, float).- Overrides:
setPositionin classSprite
-
setX
public void setX(float x)
Description copied from class:SpriteSets 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 useSprite.setBounds(float, float, float, float).
-
setY
public void setY(float y)
Description copied from class:SpriteSets 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 useSprite.setBounds(float, float, float, float).
-
setBounds
public void setBounds(float x, float y, float width, float height)Description copied from class:SpriteSets 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.
-
setSize
public void setSize(float width, float height)Description copied from class:SpriteSets 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 useSprite.setBounds(float, float, float, float).
-
setOrigin
public void setOrigin(float originX, float originY)Description copied from class:SpriteSets the origin in relation to the sprite's position for scaling and rotation.
-
setOriginCenter
public void setOriginCenter()
Description copied from class:SpritePlace origin in the center of the sprite- Overrides:
setOriginCenterin classSprite
-
flip
public void flip(boolean x, boolean y)Description copied from class:Spriteboolean parameters x,y are not setting a state, but performing a flip
-
rotate90
public void rotate90(boolean clockwise)
Description copied from class:SpriteRotates this sprite 90 degrees in-place by rotating the texture coordinates. This rotation is unaffected bySprite.setRotation(float)andSprite.rotate(float).
-
getOriginX
public float getOriginX()
Description copied from class:SpriteThe origin influencesSprite.setPosition(float, float),Sprite.setRotation(float)and the expansion direction of scalingSprite.setScale(float, float)- Overrides:
getOriginXin classSprite
-
getOriginY
public float getOriginY()
Description copied from class:SpriteThe origin influencesSprite.setPosition(float, float),Sprite.setRotation(float)and the expansion direction of scalingSprite.setScale(float, float)- Overrides:
getOriginYin classSprite
-
getWidth
public float getWidth()
-
getHeight
public float getHeight()
-
getWidthRatio
public float getWidthRatio()
-
getHeightRatio
public float getHeightRatio()
-
getAtlasRegion
public TextureAtlas.AtlasRegion getAtlasRegion()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-