public class TextGame
extends java.lang.Object
implements com.b3dgs.lionengine.Text
The use is strictly the same as Text
, just including an additional function which is
update(CameraGame)
, needed to update the text location.
Constructor and Description |
---|
TextGame(java.lang.String fontName,
int size,
com.b3dgs.lionengine.TextStyle style)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
draw(com.b3dgs.lionengine.Graphic g,
int x,
int y,
com.b3dgs.lionengine.Align alignment,
java.lang.String text) |
void |
draw(com.b3dgs.lionengine.Graphic g,
int x,
int y,
java.lang.String text) |
void |
draw(com.b3dgs.lionengine.Graphic g,
Localizable localizable,
int offsetX,
int offsetY,
com.b3dgs.lionengine.Align align,
java.lang.String text)
Renders text on graphic output, to the specified location using the specified localizable referential.
|
void |
drawRect(com.b3dgs.lionengine.Graphic g,
com.b3dgs.lionengine.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(com.b3dgs.lionengine.Graphic g,
java.lang.String str) |
int |
getStringWidth(com.b3dgs.lionengine.Graphic g,
java.lang.String str) |
int |
getWidth() |
void |
render(com.b3dgs.lionengine.Graphic g) |
void |
setAlign(com.b3dgs.lionengine.Align align) |
void |
setColor(com.b3dgs.lionengine.ColorRgba color) |
void |
setLocation(int x,
int y) |
void |
setText(java.lang.String text) |
void |
update(CameraGame camera)
Update game text to store current location view.
|
public TextGame(java.lang.String fontName, int size, com.b3dgs.lionengine.TextStyle style)
fontName
- The font name.size
- The font size.style
- The font style.public void update(CameraGame camera)
camera
- The camera reference.public void draw(com.b3dgs.lionengine.Graphic g, Localizable localizable, int offsetX, int offsetY, com.b3dgs.lionengine.Align align, java.lang.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(com.b3dgs.lionengine.Graphic g, com.b3dgs.lionengine.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 draw(com.b3dgs.lionengine.Graphic g, int x, int y, com.b3dgs.lionengine.Align alignment, java.lang.String text)
draw
in interface com.b3dgs.lionengine.Text
public void draw(com.b3dgs.lionengine.Graphic g, int x, int y, java.lang.String text)
draw
in interface com.b3dgs.lionengine.Text
public void render(com.b3dgs.lionengine.Graphic g)
render
in interface com.b3dgs.lionengine.Text
public void setLocation(int x, int y)
setLocation
in interface com.b3dgs.lionengine.Text
public void setText(java.lang.String text)
setText
in interface com.b3dgs.lionengine.Text
public void setAlign(com.b3dgs.lionengine.Align align)
setAlign
in interface com.b3dgs.lionengine.Text
public void setColor(com.b3dgs.lionengine.ColorRgba color)
setColor
in interface com.b3dgs.lionengine.Text
public int getSize()
getSize
in interface com.b3dgs.lionengine.Text
public int getLocationX()
getLocationX
in interface com.b3dgs.lionengine.Text
public int getLocationY()
getLocationY
in interface com.b3dgs.lionengine.Text
public int getWidth()
getWidth
in interface com.b3dgs.lionengine.Text
public int getHeight()
getHeight
in interface com.b3dgs.lionengine.Text
public int getStringWidth(com.b3dgs.lionengine.Graphic g, java.lang.String str)
getStringWidth
in interface com.b3dgs.lionengine.Text
public int getStringHeight(com.b3dgs.lionengine.Graphic g, java.lang.String str)
getStringHeight
in interface com.b3dgs.lionengine.Text