public class RenderableString extends Object
Drawing a renderable string is faster than drawing a regular string. This optimization is done by caching the index
within the font of every character of the string as soon as the renderable string is created. However a
RenderableString
consumes significant heap memory.
Constructor and Description |
---|
RenderableString(String string,
Font font)
Creates a renderable string.
|
Modifier and Type | Method and Description |
---|---|
Font |
getFont()
Returns the font associated with this renderable string.
|
int |
getHeight()
Returns the height of the graphical bounds of this renderable string.
|
String |
getString()
Returns the string associated with this renderable string.
|
int |
getWidth()
Returns the width of the graphical bounds of this renderable string.
|
public String getString()
public Font getFont()
public int getWidth()
This method has the same specifications as Font.stringWidth(String)
.
public int getHeight()
This method has the same specifications as Font.getHeight()
.