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
ConstructorsConstructorDescriptionAtlasSprite(TextureAtlas.AtlasRegion region) AtlasSprite(TextureAtlas.AtlasSprite sprite) -
Method Summary
Modifier and TypeMethodDescriptionvoidflip(boolean x, boolean y) boolean parameters x,y are not setting a state, but performing a flipfloatfloatfloatThe origin influencesSprite.setPosition(float, float),Sprite.setRotation(float)and the expansion direction of scalingSprite.setScale(float, float)floatThe origin influencesSprite.setPosition(float, float),Sprite.setRotation(float)and the expansion direction of scalingSprite.setScale(float, float)floatgetWidth()floatfloatgetX()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.voidPlace 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.toString()Methods inherited from class 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, translateYMethods inherited from class 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: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
-
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
-
setOriginCenter
public void setOriginCenter()Description copied from class:SpritePlace origin in the center of the sprite- Overrides:
setOriginCenterin classSprite
-
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). -
getX
-
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). -
getY
-
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). -
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
-
getHeight
-
getWidthRatio
public float getWidthRatio() -
getHeightRatio
public float getHeightRatio() -
getAtlasRegion
-
toString
-