Class TextureRegionDrawable

java.lang.Object
com.prineside.tdi2.scene2d.utils.BaseDrawable
com.prineside.tdi2.scene2d.utils.TextureRegionDrawable
All Implemented Interfaces:
Drawable, TransformDrawable
Direct Known Subclasses:
TiledDrawable

public class TextureRegionDrawable extends BaseDrawable implements TransformDrawable
Drawable for a TextureRegion.
Author:
Nathan Sweet
  • Constructor Details

    • TextureRegionDrawable

      public TextureRegionDrawable()
      Creates an uninitialized TextureRegionDrawable. The texture region must be set before use.
    • TextureRegionDrawable

      public TextureRegionDrawable(Texture texture)
    • TextureRegionDrawable

      public TextureRegionDrawable(TextureRegion region)
    • TextureRegionDrawable

      public TextureRegionDrawable(TextureRegionDrawable drawable)
  • Method Details

    • draw

      public void draw(Batch 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 Batch.getColor(), possibly by mixing its own color.
      Specified by:
      draw in interface Drawable
      Overrides:
      draw in class BaseDrawable
    • 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:
      draw in interface TransformDrawable
    • setRegion

      public void setRegion(TextureRegion region)
    • getRegion

      public TextureRegion getRegion()
    • tint

      public Drawable tint(Color tint)
      Creates a new drawable that renders the same as this drawable tinted the specified color.