|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.badlogic.gdx.graphics.g2d.NinePatch
public class NinePatch
A 3x3 grid of texture regions. Any of the regions may be omitted. Padding may be set as a hint on how to inset content on top of the ninepatch.
Field Summary | |
---|---|
static int |
BOTTOM_CENTER
|
static int |
BOTTOM_LEFT
|
static int |
BOTTOM_RIGHT
|
static int |
MIDDLE_CENTER
|
static int |
MIDDLE_LEFT
|
static int |
MIDDLE_RIGHT
|
static int |
TOP_CENTER
|
static int |
TOP_LEFT
|
static int |
TOP_RIGHT
|
Constructor Summary | |
---|---|
NinePatch(NinePatch ninePatch)
|
|
NinePatch(NinePatch ninePatch,
Color color)
|
|
NinePatch(Texture texture)
|
|
NinePatch(Texture texture,
Color color)
|
|
NinePatch(Texture texture,
int left,
int right,
int top,
int bottom)
|
|
NinePatch(TextureRegion... patches)
|
|
NinePatch(TextureRegion region)
|
|
NinePatch(TextureRegion region,
Color color)
|
|
NinePatch(TextureRegion region,
int left,
int right,
int top,
int bottom)
|
Method Summary | |
---|---|
void |
draw(SpriteBatch batch,
float x,
float y,
float width,
float height)
|
float |
getBottomHeight()
|
Color |
getColor()
|
float |
getLeftWidth()
|
float |
getMiddleHeight()
|
float |
getMiddleWidth()
|
float |
getPadBottom()
Returns the bottom padding if set, else returns getBottomHeight() . |
float |
getPadLeft()
Returns the left padding if set, else returns getLeftWidth() . |
float |
getPadRight()
Returns the right padding if set, else returns getRightWidth() . |
float |
getPadTop()
Returns the top padding if set, else returns getTopHeight() . |
float |
getRightWidth()
|
Texture |
getTexture()
|
float |
getTopHeight()
|
float |
getTotalHeight()
|
float |
getTotalWidth()
|
void |
setBottomHeight(float bottomHeight)
|
void |
setColor(Color color)
|
void |
setLeftWidth(float leftWidth)
|
void |
setMiddleHeight(float middleHeight)
|
void |
setMiddleWidth(float middleWidth)
|
void |
setPadBottom(int bottom)
|
void |
setPadding(int left,
int right,
int top,
int bottom)
|
void |
setPadLeft(int left)
|
void |
setPadRight(int right)
|
void |
setPadTop(int top)
|
void |
setRightWidth(float rightWidth)
|
void |
setTopHeight(float topHeight)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int TOP_LEFT
public static final int TOP_CENTER
public static final int TOP_RIGHT
public static final int MIDDLE_LEFT
public static final int MIDDLE_CENTER
public static final int MIDDLE_RIGHT
public static final int BOTTOM_LEFT
public static final int BOTTOM_CENTER
public static final int BOTTOM_RIGHT
Constructor Detail |
---|
public NinePatch(Texture texture, int left, int right, int top, int bottom)
left
- Pixels from left edge.right
- Pixels from right edge.top
- Pixels from top edge.bottom
- Pixels from bottom edge.public NinePatch(TextureRegion region, int left, int right, int top, int bottom)
left
- Pixels from left edge.right
- Pixels from right edge.top
- Pixels from top edge.bottom
- Pixels from bottom edge.public NinePatch(Texture texture, Color color)
public NinePatch(Texture texture)
public NinePatch(TextureRegion region, Color color)
public NinePatch(TextureRegion region)
public NinePatch(TextureRegion... patches)
public NinePatch(NinePatch ninePatch)
public NinePatch(NinePatch ninePatch, Color color)
Method Detail |
---|
public void draw(SpriteBatch batch, float x, float y, float width, float height)
public void setColor(Color color)
public Color getColor()
public float getLeftWidth()
public void setLeftWidth(float leftWidth)
public float getRightWidth()
public void setRightWidth(float rightWidth)
public float getTopHeight()
public void setTopHeight(float topHeight)
public float getBottomHeight()
public void setBottomHeight(float bottomHeight)
public float getMiddleWidth()
public void setMiddleWidth(float middleWidth)
public float getMiddleHeight()
public void setMiddleHeight(float middleHeight)
public float getTotalWidth()
public float getTotalHeight()
public void setPadding(int left, int right, int top, int bottom)
public float getPadLeft()
getLeftWidth()
.
public void setPadLeft(int left)
public float getPadRight()
getRightWidth()
.
public void setPadRight(int right)
public float getPadTop()
getTopHeight()
.
public void setPadTop(int top)
public float getPadBottom()
getBottomHeight()
.
public void setPadBottom(int bottom)
public Texture getTexture()
|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |