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
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
ConstructorDescriptionAtlasSprite
(TextureAtlas.AtlasRegion region) AtlasSprite
(TextureAtlas.AtlasSprite sprite) -
Method Summary
Modifier and TypeMethodDescriptionvoid
flip
(boolean x, boolean y) boolean parameters x,y are not setting a state, but performing a flipfloat
float
float
The origin influencesSprite.setPosition(float, float)
,Sprite.setRotation(float)
and the expansion direction of scalingSprite.setScale(float, float)
float
The origin influencesSprite.setPosition(float, float)
,Sprite.setRotation(float)
and the expansion direction of scalingSprite.setScale(float, float)
float
getWidth()
float
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
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.toString()
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 Details
-
AtlasSprite
-
AtlasSprite
-
-
Method Details
-
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
-
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)
. -
getX
public float getX() -
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)
. -
getY
public float getY() -
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)
. -
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
-
toString
-