public class DrawCommand
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
int |
ACTION
Integers for different commands.
x1/y1 are usually (x,y) for the upper-left corner. x2/y2 are either the width/height or the lower-right corner cords. ACTION is one of the above final actions. |
int |
c
Integers for different commands.
x1/y1 are usually (x,y) for the upper-left corner. x2/y2 are either the width/height or the lower-right corner cords. ACTION is one of the above final actions. |
static int |
DRAW_BTN |
static int |
DRAW_DEF_BACKGROUND |
static int |
DRAW_RECT |
static int |
DRAW_TEXT |
static int |
DRAW_TEXTURED_RECT |
int |
id
Integers for different commands.
x1/y1 are usually (x,y) for the upper-left corner. x2/y2 are either the width/height or the lower-right corner cords. ACTION is one of the above final actions. |
java.lang.String |
s |
int |
x1
Integers for different commands.
x1/y1 are usually (x,y) for the upper-left corner. x2/y2 are either the width/height or the lower-right corner cords. ACTION is one of the above final actions. |
int |
x2
Integers for different commands.
x1/y1 are usually (x,y) for the upper-left corner. x2/y2 are either the width/height or the lower-right corner cords. ACTION is one of the above final actions. |
int |
y1
Integers for different commands.
x1/y1 are usually (x,y) for the upper-left corner. x2/y2 are either the width/height or the lower-right corner cords. ACTION is one of the above final actions. |
int |
y2
Integers for different commands.
x1/y1 are usually (x,y) for the upper-left corner. x2/y2 are either the width/height or the lower-right corner cords. ACTION is one of the above final actions. |
| Modifier and Type | Method and Description |
|---|---|
static DrawCommand |
compileButton(int x,
int y,
int w,
int id,
java.lang.String s)
Generates a DrawCommand for drawing a button.
Use in the gui.initCommands only, or you get wierd results. |
static DrawCommand |
compileRect(int x1,
int y1,
int x2,
int y2,
int c)
Generates a DrawCommand for drawing a rectangle.
|
static DrawCommand |
compileText(java.lang.String text,
int x,
int y,
int c)
Generates a DrawCommand for drawing a string.
|
static DrawCommand |
compileTexturedRect(int x,
int y,
int w,
int h,
int c)
Generates a DrawCommand for drawing a textured rectangle.
|
int |
getAction()
Gets the action of the drawcommand
|
static java.util.ArrayList<DrawCommand> |
parseJSON(JSONArray commands)
Parses a JSONArray to generate an ArrayList of DrawCommands.
|
JSONObject |
toJSON()
Converts DrawCommand to JSONObject
|
public static final int DRAW_TEXT
public static final int DRAW_RECT
public static final int DRAW_TEXTURED_RECT
public static final int DRAW_DEF_BACKGROUND
public static final int DRAW_BTN
public int x1
public int x2
public int y1
public int y2
public int ACTION
public int c
public int id
public java.lang.String s
public static DrawCommand compileText(java.lang.String text, int x, int y, int c)
text - x - y - c - public static DrawCommand compileRect(int x1, int y1, int x2, int y2, int c)
x1 - y1 - x2 - y2 - c - public static DrawCommand compileTexturedRect(int x, int y, int w, int h, int c)
x - y - w - h - c - public static DrawCommand compileButton(int x, int y, int w, int id, java.lang.String s)
x - y - w - id - s - public int getAction()
public static java.util.ArrayList<DrawCommand> parseJSON(JSONArray commands)
commands - public JSONObject toJSON()