public class Text extends Shape
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_SIZE |
DEFAULT_COLOR
Constructor and Description |
---|
Text(double x,
double y,
java.lang.String t)
Creates text centered at the given coordinates in the default color and size.
|
Text(double x,
double y,
java.lang.String t,
int s)
Creates text centered at the given coordinates in the default color and given size.
|
Text(Point cen,
java.lang.String t)
Creates text centered at the given point in the default color and size.
|
Text(Point cen,
java.lang.String t,
int s)
Creates text centered at the given point in the default color and given size.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(Point point)
Determines if this text contains the given point.
|
void |
draw(android.graphics.Canvas canvas)
Draws this text on the given canvas.
|
Point |
getCenter()
Returns the center of this text.
|
java.lang.String |
getText()
Returns the string of this text.
|
void |
move(double dx,
double dy)
Moves this text by the given displacement.
|
public static final int DEFAULT_SIZE
public Text(double x, double y, java.lang.String t)
x
- the x-coordinate of the text centery
- the y-coordinate of the text centert
- the text messagepublic Text(double x, double y, java.lang.String t, int s)
x
- the x-coordinate of the text centery
- the y-coordinate of the text centert
- the text messages
- the size of the text messagepublic Text(Point cen, java.lang.String t)
cen
- the center of the textt
- the text messagepublic Text(Point cen, java.lang.String t, int s)
cen
- the center of the textt
- the text messages
- the size of the text messagepublic boolean contains(Point point)
public void draw(android.graphics.Canvas canvas)
public Point getCenter()
public java.lang.String getText()