Class TextureAtlas.AtlasSprite
- java.lang.Object
-
- gaia.cu9.ari.gaiaorbit.util.gdx.g2d.TextureRegion
-
- gaia.cu9.ari.gaiaorbit.util.gdx.g2d.Sprite
-
- gaia.cu9.ari.gaiaorbit.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 void
flip(boolean x, boolean y)
boolean parameters x,y are not setting a state, but performing a flipTextureAtlas.AtlasRegion
getAtlasRegion()
float
getHeight()
float
getHeightRatio()
float
getOriginX()
The origin influencesSprite.setPosition(float, float)
,Sprite.setRotation(float)
and the expansion direction of scalingSprite.setScale(float, float)
float
getOriginY()
The origin influencesSprite.setPosition(float, float)
,Sprite.setRotation(float)
and the expansion direction of scalingSprite.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 spritevoid
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.java.lang.String
toString()
-
Methods inherited from class gaia.cu9.ari.gaiaorbit.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 gaia.cu9.ari.gaiaorbit.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: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 useSprite.setBounds(float, float, float, float)
.- Overrides:
setPosition
in classSprite
-
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 useSprite.setBounds(float, float, float, float)
.
-
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 useSprite.setBounds(float, float, float, float)
.
-
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.
-
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 useSprite.setBounds(float, float, float, float)
.
-
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.
-
setOriginCenter
public void setOriginCenter()
Description copied from class:Sprite
Place origin in the center of the sprite- Overrides:
setOriginCenter
in classSprite
-
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
-
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 bySprite.setRotation(float)
andSprite.rotate(float)
.
-
getOriginX
public float getOriginX()
Description copied from class:Sprite
The origin influencesSprite.setPosition(float, float)
,Sprite.setRotation(float)
and the expansion direction of scalingSprite.setScale(float, float)
- Overrides:
getOriginX
in classSprite
-
getOriginY
public float getOriginY()
Description copied from class:Sprite
The origin influencesSprite.setPosition(float, float)
,Sprite.setRotation(float)
and the expansion direction of scalingSprite.setScale(float, float)
- Overrides:
getOriginY
in 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:
toString
in classjava.lang.Object
-
-