Class SpriteDrawable
- java.lang.Object
-
- com.badlogic.gdx.scenes.scene2d.utils.BaseDrawable
-
- com.badlogic.gdx.scenes.scene2d.utils.SpriteDrawable
-
- All Implemented Interfaces:
Drawable,TransformDrawable
public class SpriteDrawable extends BaseDrawable implements TransformDrawable
Drawable for aSprite.
-
-
Constructor Summary
Constructors Constructor Description SpriteDrawable()Creates an uninitialized SpriteDrawable.SpriteDrawable(Sprite sprite)SpriteDrawable(SpriteDrawable drawable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddraw(Batch batch, float x, float y, float width, float height)Draws this drawable at the specified bounds.voiddraw(Batch batch, float x, float y, float originX, float originY, float width, float height, float scaleX, float scaleY, float rotation)SpritegetSprite()voidsetSprite(Sprite sprite)SpriteDrawabletint(Color tint)Creates a new drawable that renders the same as this drawable tinted the specified color.-
Methods inherited from class com.badlogic.gdx.scenes.scene2d.utils.BaseDrawable
getBottomHeight, getLeftWidth, getMinHeight, getMinWidth, getName, getRightWidth, getTopHeight, setBottomHeight, setLeftWidth, setMinHeight, setMinSize, setMinWidth, setName, setPadding, setRightWidth, setTopHeight, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.badlogic.gdx.scenes.scene2d.utils.Drawable
getBottomHeight, getLeftWidth, getMinHeight, getMinWidth, getRightWidth, getTopHeight, setBottomHeight, setLeftWidth, setMinHeight, setMinWidth, setRightWidth, setTopHeight
-
-
-
-
Constructor Detail
-
SpriteDrawable
public SpriteDrawable()
Creates an uninitialized SpriteDrawable. The sprite must be set before use.
-
SpriteDrawable
public SpriteDrawable(Sprite sprite)
-
SpriteDrawable
public SpriteDrawable(SpriteDrawable drawable)
-
-
Method Detail
-
draw
public void draw(Batch batch, float x, float y, float width, float height)
Description copied from interface:DrawableDraws this drawable at the specified bounds. The drawable should be tinted withBatch.getColor(), possibly by mixing its own color.- Specified by:
drawin interfaceDrawable- Overrides:
drawin classBaseDrawable
-
draw
public void draw(Batch batch, float x, float y, float originX, float originY, float width, float height, float scaleX, float scaleY, float rotation)
- Specified by:
drawin interfaceTransformDrawable
-
setSprite
public void setSprite(Sprite sprite)
-
getSprite
public Sprite getSprite()
-
tint
public SpriteDrawable tint(Color tint)
Creates a new drawable that renders the same as this drawable tinted the specified color.
-
-