public class UIUtil
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
UIUtil.CornerStyle |
static class |
UIUtil.YMoveKind
A vertical move triggered by keyboard keys.
|
Constructor and Description |
---|
UIUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
drawLimitedWidthText(com.badlogic.gdx.graphics.g2d.Batch batch,
com.badlogic.gdx.graphics.g2d.BitmapFont font,
java.lang.String text,
com.badlogic.gdx.graphics.Color color,
int align,
float width,
float x,
float y)
Writes
text at (x, y) by cutting off using "…" if it gets
wider than width . |
static void |
drawMarginsAround(float botLeftX,
float botLeftY,
int width,
int height,
int xmargin,
int ymargin,
com.badlogic.gdx.graphics.Color c)
Draws margins around a rectangle
|
static void |
drawMarginsAround(com.badlogic.gdx.graphics.glutils.ShapeRenderer renderer_,
com.badlogic.gdx.scenes.scene2d.Actor a,
float margin,
com.badlogic.gdx.graphics.Color color,
UIUtil.CornerStyle cornerStyle)
Draws margins around an actor.
|
static void |
drawMarginsAround(com.badlogic.gdx.graphics.glutils.ShapeRenderer renderer_,
float botLeftX,
float botLeftY,
float width,
float height,
float margin,
com.badlogic.gdx.graphics.Color color,
UIUtil.CornerStyle cornerStyle) |
static void |
drawMarginsAround(com.badlogic.gdx.graphics.glutils.ShapeRenderer renderer_,
float botLeftX,
float botLeftY,
float width,
float height,
float margin,
com.badlogic.gdx.graphics.Color color,
UIUtil.CornerStyle cornerStyle,
float zoomX,
float zoomY) |
static void |
drawRectangle(float botLeftX,
float botLeftY,
float width,
float height,
com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType st,
com.badlogic.gdx.graphics.Color color)
Draws a rectangle using a
ShapeRenderer , allocating a new one for
the occasion. |
static void |
drawRectangle(com.badlogic.gdx.graphics.glutils.ShapeRenderer sRender_,
float botLeftX,
float botLeftY,
float width,
float height,
com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType st,
com.badlogic.gdx.graphics.Color color)
Draws a rectangle using a
ShapeRenderer . |
public static void drawLimitedWidthText(com.badlogic.gdx.graphics.g2d.Batch batch, com.badlogic.gdx.graphics.g2d.BitmapFont font, java.lang.String text, com.badlogic.gdx.graphics.Color color, int align, float width, float x, float y)
text
at (x, y)
by cutting off using "…" if it gets
wider than width
.batch
- font
- The font to usetext
- The text to drawcolor
- The text's coloralign
- The alignment (see Align
).width
- The desired width of the textx
- Where to drawy
- Where to drawpublic static void drawMarginsAround(com.badlogic.gdx.graphics.glutils.ShapeRenderer renderer_, com.badlogic.gdx.scenes.scene2d.Actor a, float margin, com.badlogic.gdx.graphics.Color color, UIUtil.CornerStyle cornerStyle)
renderer_
- The renderer to use. If null
a new one will be
allocated.a
- the actor to draw aroundmargin
- The size of the margin to draw.color
- The margins' colors.public static void drawMarginsAround(float botLeftX, float botLeftY, int width, int height, int xmargin, int ymargin, com.badlogic.gdx.graphics.Color c)
botLeftX
- The rectangle's bottom left.botLeftY
- The rectangle's bottom left.width
- The rectangle's width.height
- The rectangle's height.xmargin
- The size of the left margin and the size of the right margin.ymargin
- The size of the bottom margin and the size of the top margin.c
- The margins' colors.public static void drawMarginsAround(com.badlogic.gdx.graphics.glutils.ShapeRenderer renderer_, float botLeftX, float botLeftY, float width, float height, float margin, com.badlogic.gdx.graphics.Color color, UIUtil.CornerStyle cornerStyle)
renderer_
- The renderer to use. If null
a new one will be
allocated.botLeftX
- The bottom left x cell of the rectangle to draw around.botLeftY
- The bottom left y cell of the rectangle to draw around.width
- The width of the button considered.height
- The width of the button considered.margin
- The size of the margin to draw.color
- The color to drawcornerStyle
- The style with which to draw the marginspublic static void drawMarginsAround(com.badlogic.gdx.graphics.glutils.ShapeRenderer renderer_, float botLeftX, float botLeftY, float width, float height, float margin, com.badlogic.gdx.graphics.Color color, UIUtil.CornerStyle cornerStyle, float zoomX, float zoomY)
renderer_
- The renderer to use. If null
a new one will be
allocated.botLeftX
- The bottom left x cell of the rectangle to draw around.botLeftY
- The bottom left y cell of the rectangle to draw around.width
- The width of the button considered.height
- The width of the button considered.margin
- The size of the margin to draw.color
- The color to drawcornerStyle
- The style with which to draw the marginszoomX
- A multiplier for the world x-size of non-ShapeRenderer
objects, that needs to be reversed for thiszoomY
- A multiplier for the world y-size of non-ShapeRenderer
objects, that needs to be reversed for thispublic static void drawRectangle(com.badlogic.gdx.graphics.glutils.ShapeRenderer sRender_, float botLeftX, float botLeftY, float width, float height, com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType st, com.badlogic.gdx.graphics.Color color)
ShapeRenderer
.sRender_
- The renderer to use. If null
a new one will be
allocated.botLeftX
- The bottom left x of the rectangle.botLeftY
- The bottom left y of the rectangle.width
- The rectangle's widthheight
- The rectangle's heightst
- The style to usecolor
- The rectangle's colorpublic static void drawRectangle(float botLeftX, float botLeftY, float width, float height, com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType st, com.badlogic.gdx.graphics.Color color)
ShapeRenderer
, allocating a new one for
the occasion.botLeftX
- The bottom left x of the rectangle.botLeftY
- The bottom left y of the rectangle.width
- The rectangle's widthheight
- The rectangle's heightst
- The style to usecolor
- The rectangle's colorCopyright © Eben Howard 2012–2022. All rights reserved.