APIdia Launch Partner
Top Description Fields Constructors Methods
com.badlogic.gdx.scenes.scene2d.utils

public Class SpriteDrawable

extends BaseDrawable
implements TransformDrawable
Class Inheritance
All Implemented Interfaces
com.badlogic.gdx.scenes.scene2d.utils.TransformDrawable, com.badlogic.gdx.scenes.scene2d.utils.Drawable
Imports
com.badlogic.gdx.graphics.Color, com.badlogic.gdx.graphics.g2d.Batch, .Sprite, .TextureAtlas.AtlasSprite

Drawable for a Sprite.
Author
Nathan Sweet

Field Summary

Modifier and TypeField and Description
private Sprite

Constructor Summary

AccessConstructor and Description
public
SpriteDrawable()

Creates an uninitialized SpriteDrawable.

public
public

Method Summary

Modifier and TypeMethod and Description
public void
draw(Batch batch, float x, float y, float width, float height)

Overrides com.badlogic.gdx.scenes.scene2d.utils.BaseDrawable.draw.

Implements com.badlogic.gdx.scenes.scene2d.utils.Drawable.draw.

Draws this drawable at the specified bounds.

public void
draw(Batch batch, float x, float y, float originX, float originY, float width, float height, float scaleX, float scaleY, float rotation)

Implements com.badlogic.gdx.scenes.scene2d.utils.TransformDrawable.draw.

public Sprite
public void
setSprite(Sprite sprite)

public SpriteDrawable
tint(Color tint)

Creates a new drawable that renders the same as this drawable tinted the specified color.

Inherited from com.badlogic.gdx.scenes.scene2d.utils.BaseDrawable:
getBottomHeightgetLeftWidthgetMinHeightgetMinWidthgetNamegetRightWidthgetTopHeightsetBottomHeightsetLeftWidthsetMinHeightsetMinWidthsetNamesetRightWidthsetTopHeighttoString

Field Detail

spriteback to summary
private Sprite sprite

Constructor Detail

SpriteDrawableback to summary
public SpriteDrawable()

Creates an uninitialized SpriteDrawable. The sprite must be set before use.

SpriteDrawableback to summary
public SpriteDrawable(Sprite sprite)
SpriteDrawableback to summary
public SpriteDrawable(SpriteDrawable drawable)

Method Detail

drawback to summary
public void draw(Batch batch, float x, float y, float width, float height)

Overrides com.badlogic.gdx.scenes.scene2d.utils.BaseDrawable.draw.

Implements com.badlogic.gdx.scenes.scene2d.utils.Drawable.draw.

Doc from com.badlogic.gdx.scenes.scene2d.utils.Drawable.draw.

Draws this drawable at the specified bounds. The drawable should be tinted with Batch#getColor(), possibly by mixing its own color.

drawback to summary
public void draw(Batch batch, float x, float y, float originX, float originY, float width, float height, float scaleX, float scaleY, float rotation)

Implements com.badlogic.gdx.scenes.scene2d.utils.TransformDrawable.draw.

getSpriteback to summary
public Sprite getSprite()
setSpriteback to summary
public void setSprite(Sprite sprite)
tintback to summary
public SpriteDrawable tint(Color tint)

Creates a new drawable that renders the same as this drawable tinted the specified color.