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

public Class TextureRegionDrawable

extends BaseDrawable
implements TransformDrawable
Class Inheritance
All Implemented Interfaces
com.badlogic.gdx.scenes.scene2d.utils.TransformDrawable, com.badlogic.gdx.scenes.scene2d.utils.Drawable
Known Direct Subclasses
com.badlogic.gdx.scenes.scene2d.utils.TiledDrawable
Imports
com.badlogic.gdx.graphics.Color, .Texture, com.badlogic.gdx.graphics.g2d.Batch, .Sprite, .TextureAtlas.AtlasRegion, .TextureAtlas.AtlasSprite, .TextureRegion

Drawable for a TextureRegion.
Author
Nathan Sweet

Field Summary

Modifier and TypeField and Description
private TextureRegion

Constructor Summary

AccessConstructor and Description
public
TextureRegionDrawable()

Creates an uninitialized TextureRegionDrawable.

public
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 TextureRegion
public void
public Drawable
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

regionback to summary
private TextureRegion region

Constructor Detail

TextureRegionDrawableback to summary
public TextureRegionDrawable()

Creates an uninitialized TextureRegionDrawable. The texture region must be set before use.

TextureRegionDrawableback to summary
public TextureRegionDrawable(Texture texture)
TextureRegionDrawableback to summary
public TextureRegionDrawable(TextureRegion region)
TextureRegionDrawableback to summary
public TextureRegionDrawable(TextureRegionDrawable 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.

getRegionback to summary
public TextureRegion getRegion()
setRegionback to summary
public void setRegion(TextureRegion region)
tintback to summary
public Drawable tint(Color tint)

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