Class TiledDrawable
- java.lang.Object
-
- com.badlogic.gdx.scenes.scene2d.utils.BaseDrawable
-
- com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable
-
- com.badlogic.gdx.scenes.scene2d.utils.TiledDrawable
-
- All Implemented Interfaces:
Drawable
,TransformDrawable
public class TiledDrawable extends TextureRegionDrawable
Draws aTextureRegion
repeatedly to fill the area, instead of stretching it.
-
-
Constructor Summary
Constructors Constructor Description TiledDrawable()
TiledDrawable(TextureRegion region)
TiledDrawable(TextureRegionDrawable drawable)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
draw(Batch batch, float x, float y, float width, float height)
Draws this drawable at the specified bounds.void
draw(Batch batch, float x, float y, float originX, float originY, float width, float height, float scaleX, float scaleY, float rotation)
static void
draw(Batch batch, TextureRegion textureRegion, float x, float y, float width, float height, float scale, int align)
int
getAlign()
Color
getColor()
float
getScale()
void
setAlign(int align)
void
setScale(float scale)
TiledDrawable
tint(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.TextureRegionDrawable
getRegion, setRegion
-
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
-
TiledDrawable
public TiledDrawable()
-
TiledDrawable
public TiledDrawable(TextureRegion region)
-
TiledDrawable
public TiledDrawable(TextureRegionDrawable drawable)
-
-
Method Detail
-
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 withBatch.getColor()
, possibly by mixing its own color.- Specified by:
draw
in interfaceDrawable
- Overrides:
draw
in classTextureRegionDrawable
-
draw
public static void draw(Batch batch, TextureRegion textureRegion, float x, float y, float width, float height, float scale, int align)
-
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 interfaceTransformDrawable
- Overrides:
draw
in classTextureRegionDrawable
-
getColor
public Color getColor()
-
setScale
public void setScale(float scale)
-
getScale
public float getScale()
-
getAlign
public int getAlign()
-
setAlign
public void setAlign(int align)
-
tint
public TiledDrawable tint(Color tint)
Description copied from class:TextureRegionDrawable
Creates a new drawable that renders the same as this drawable tinted the specified color.- Overrides:
tint
in classTextureRegionDrawable
-
-