|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.rico.engine.effect.ortho.AbstractOrthoOverlay
de.rico.engine.effect.ortho.TextRenderer
public class TextRenderer
This class can be used to draw text onto the sceen.
Constructor Summary | |
---|---|
TextRenderer()
Creates a new text renderer with the default color white and the font type HELVETICA_12. |
|
TextRenderer(Color4f color)
Creates a new text renderer with the specified color and the font type HELVETICA_12. |
|
TextRenderer(Font font)
Creates a new text renderer with the specified font type and the default text color white. |
|
TextRenderer(Font font,
Color4f color)
Creates a new text renderer with the specified font type and the specified text color. |
Method Summary | |
---|---|
void |
drawString(java.lang.String text,
int x,
int y)
Draws the specified string at the specified position. |
void |
drawString(java.lang.String text,
int x,
int y,
Color4f c)
Draws the specified string at the specified position with the specified color. |
Font |
getFont()
Returns the font that is currently used for text rendering by this text renderer object. |
int |
getStringWidth(java.lang.String text)
Returns the width of the specified String using the current font. |
void |
setFont(Font font)
Sets the font of the text renderer. |
Methods inherited from class de.rico.engine.effect.ortho.AbstractOrthoOverlay |
---|
getColor, setColor |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TextRenderer()
public TextRenderer(Color4f color)
color
- text colorpublic TextRenderer(Font font)
font
- font type (from Font enumeration)public TextRenderer(Font font, Color4f color)
font
- font type (from Font enumeration)color
- text colorMethod Detail |
---|
public void setFont(Font font)
font
- new fontpublic Font getFont()
public void drawString(java.lang.String text, int x, int y)
text
- text to draw on screenx
- x-coordinate for starting to drawy
- y-coordinate for starting to drawpublic void drawString(java.lang.String text, int x, int y, Color4f c)
text
- text to draw on screenx
- x-coordinate for starting to drawy
- y-coordinate for starting to drawc
- color to use for the textpublic int getStringWidth(java.lang.String text)
text
- text to calculate width for
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |