public interface GameFontCache
| Modifier and Type | Method and Description |
|---|---|
void |
addText(java.lang.CharSequence str,
float x,
float y)
Adds text to the cache
|
void |
addText(java.lang.CharSequence str,
float x,
float y,
float targetWidth,
int halign,
boolean wrap)
Adds text to the cache
|
void |
clear()
Clears all text from the cache
|
void |
draw(Graphics g)
Draws the cache to the
Graphics context |
Color |
getColor()
Returns the
Color used for subsequent text operations |
GameFont |
getFont()
Returns the underlying
GameFont for this cache |
void |
setAllAlphas(float alpha)
Sets the
Color alpha for previous text operations |
void |
setAllColors(Color color)
Sets the
Color for previous text operations |
void |
setColor(Color color)
Sets the
Color for subsequent text operations |
void |
setPosition(float x,
float y)
Sets the position of the cache
|
void |
setText(java.lang.CharSequence str,
float x,
float y)
Clears all text from the cache and adds a new text sequence
|
void |
setText(java.lang.CharSequence str,
float x,
float y,
float targetWidth,
int halign,
boolean wrap)
Clears all text from the cache and adds a new text sequence
|
void |
translate(float x,
float y)
Sets the position of the text relative to its current position
|
void addText(java.lang.CharSequence str,
float x,
float y)
str - The text to be addedx - The x coordinate to add the text toy - The y coordinate to add the text tovoid addText(java.lang.CharSequence str,
float x,
float y,
float targetWidth,
int halign,
boolean wrap)
str - The text to be addedx - The x coordinate to add the text toy - The y coordinate to add the text totargetWidth - The target width of the text (text will wrap if exceeded)halign - The horizontal alignment based on Alignvoid clear()
void draw(Graphics g)
Graphics contextg - The Graphics context to draw toColor getColor()
Color used for subsequent text operationsColor to draw withvoid setColor(Color color)
Color for subsequent text operationscolor - The Color to draw withvoid setAllColors(Color color)
Color for previous text operationscolor - The Color to draw withvoid setAllAlphas(float alpha)
Color alpha for previous text operationsalpha - The alpha to draw withvoid setText(java.lang.CharSequence str,
float x,
float y)
str - The text to be addedx - The x coordinate to add the text toy - The y coordinate to add the text tovoid setText(java.lang.CharSequence str,
float x,
float y,
float targetWidth,
int halign,
boolean wrap)
str - The text to be addedx - The x coordinate to add the text toy - The y coordinate to add the text totargetWidth - The target width of the text (text will wrap if exceeded)halign - The horizontal alignment of the text based on Alignwrap - True if the text should wrap when exceeding the targetWidth, false if the text should clipvoid translate(float x,
float y)
x - The amount to move by on the x axisy - The amount to move by on the y axisvoid setPosition(float x,
float y)
x - The amount to move by on the x axisy - The amount to move by on the y axis