public class NinePatchDrawable extends BaseDrawable implements TransformDrawable
NinePatch.
The drawable sizes are set when the ninepatch is set, but they are separate values. Eg, Drawable.getLeftWidth() could
be set to more than NinePatch.getLeftWidth() in order to provide more space on the left than actually exists in the
ninepatch.
The min size is set to the ninepatch total size by default. It could be set to the left+right and top+bottom, excluding the middle size, to allow the drawable to be sized down as small as possible.
| Constructor and Description |
|---|
NinePatchDrawable()
Creates an uninitialized NinePatchDrawable.
|
NinePatchDrawable(NinePatch patch) |
NinePatchDrawable(NinePatchDrawable drawable) |
| Modifier and Type | Method and 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) |
NinePatch |
getPatch() |
void |
setPatch(NinePatch patch) |
NinePatchDrawable |
tint(Color tint)
Creates a new drawable that renders the same as this drawable tinted the specified color.
|
getBottomHeight, getLeftWidth, getMinHeight, getMinWidth, getName, getRightWidth, getTopHeight, setBottomHeight, setLeftWidth, setMinHeight, setMinWidth, setName, setRightWidth, setTopHeight, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetBottomHeight, getLeftWidth, getMinHeight, getMinWidth, getRightWidth, getTopHeight, setBottomHeight, setLeftWidth, setMinHeight, setMinWidth, setRightWidth, setTopHeightpublic NinePatchDrawable()
set before use.public NinePatchDrawable(NinePatch patch)
public NinePatchDrawable(NinePatchDrawable drawable)
public void draw(Batch batch, float x, float y, float width, float height)
DrawableBatch.getColor(), possibly by mixing
its own color.draw in interface Drawabledraw in class BaseDrawablepublic void draw(Batch batch, float x, float y, float originX, float originY, float width, float height, float scaleX, float scaleY, float rotation)
draw in interface TransformDrawablepublic void setPatch(NinePatch patch)
public NinePatch getPatch()
public NinePatchDrawable tint(Color tint)