com.badlogic.gdx.scenes.scene2d.utils
Class SpriteDrawable

java.lang.Object
  extended by com.badlogic.gdx.scenes.scene2d.utils.BaseDrawable
      extended by com.badlogic.gdx.scenes.scene2d.utils.SpriteDrawable
All Implemented Interfaces:
Drawable

public class SpriteDrawable
extends BaseDrawable

Drawable for a Sprite.

Author:
Nathan Sweet

Constructor Summary
SpriteDrawable()
          Creates an unitialized SpriteDrawable.
SpriteDrawable(Sprite sprite)
           
SpriteDrawable(SpriteDrawable drawable)
           
 
Method Summary
 void draw(SpriteBatch batch, float x, float y, float width, float height)
          Draws this drawable at the specified bounds.
 Sprite getSprite()
           
 void setSprite(Sprite sprite)
           
 
Methods inherited from class com.badlogic.gdx.scenes.scene2d.utils.BaseDrawable
getBottomHeight, getLeftWidth, getMinHeight, getMinWidth, getRightWidth, getTopHeight, setBottomHeight, setLeftWidth, setMinHeight, setMinWidth, setRightWidth, setTopHeight
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpriteDrawable

public SpriteDrawable()
Creates an unitialized SpriteDrawable. The sprite must be set before use.


SpriteDrawable

public SpriteDrawable(Sprite sprite)

SpriteDrawable

public SpriteDrawable(SpriteDrawable drawable)
Method Detail

draw

public void draw(SpriteBatch batch,
                 float x,
                 float y,
                 float width,
                 float height)
Description copied from interface: Drawable
Draws this drawable at the specified bounds. The drawable should be tinted with SpriteBatch.getColor(), possibly by mixing its own color.

Specified by:
draw in interface Drawable
Overrides:
draw in class BaseDrawable

setSprite

public void setSprite(Sprite sprite)

getSprite

public Sprite getSprite()


Copyright © 2013. All Rights Reserved.