public class TextGame extends Object implements Text
The use is strictly the same as Text
, just including an additional function which is
update(Viewer)
, needed to update the text location.
DIALOG, SANS_SERIF, SERIF
Constructor and Description |
---|
TextGame(String fontName,
int size,
TextStyle style)
Create a text game.
|
Modifier and Type | Method and Description |
---|---|
void |
draw(Graphic g,
int x,
int y,
Align alignment,
String text) |
void |
draw(Graphic g,
int x,
int y,
String text) |
void |
draw(Graphic g,
Localizable localizable,
int offsetX,
int offsetY,
Align align,
String text)
Renders text on graphic output, to the specified location using the specified localizable referential.
|
void |
drawRect(Graphic g,
ColorRgba color,
int x,
int y,
int width,
int height)
Renders text on graphic output, to the specified location using the specified localizable referential.
|
int |
getHeight() |
int |
getLocationX() |
int |
getLocationY() |
int |
getSize() |
int |
getStringHeight(Graphic g,
String str) |
int |
getStringWidth(Graphic g,
String str) |
int |
getWidth() |
void |
render(Graphic g) |
void |
setAlign(Align align) |
void |
setColor(ColorRgba color) |
void |
setLocation(int x,
int y) |
void |
setText(String text) |
void |
update(Viewer viewer)
Update game text to store current location view.
|
public void update(Viewer viewer)
viewer
- The viewer reference.public void draw(Graphic g, Localizable localizable, int offsetX, int offsetY, Align align, String text)
g
- The graphic output.localizable
- The localizable used to draw the text.offsetX
- The horizontal offset from the localizable horizontal location.offsetY
- The vertical offset from the localizable vertical location.align
- The alignment value.text
- The text string.public void drawRect(Graphic g, ColorRgba color, int x, int y, int width, int height)
g
- The graphic output.color
- The rectangle color.x
- The horizontal location.y
- The vertical location.width
- The rectangle width.height
- The rectangle height.public void render(Graphic g)
render
in interface Renderable
public void setLocation(int x, int y)
setLocation
in interface Text
public int getLocationX()
getLocationX
in interface Text
public int getLocationY()
getLocationY
in interface Text
public int getStringWidth(Graphic g, String str)
getStringWidth
in interface Text
public int getStringHeight(Graphic g, String str)
getStringHeight
in interface Text
Copyright © 2016 Byron 3D Games Studio. All rights reserved.