Package ej.microui.display
Class RenderableString
- java.lang.Object
-
- ej.microui.display.RenderableString
-
public class RenderableString extends Object
Represents graphical information related to the drawing of a string with a font.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
RenderableStringconsumes significant heap memory.
-
-
Constructor Summary
Constructors Constructor Description RenderableString(String string, Font font)Creates a renderable string.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FontgetFont()Returns the font associated with this renderable string.intgetHeight()Returns the height of the graphical bounds of this renderable string.StringgetString()Returns the string associated with this renderable string.intgetWidth()Returns the width of the graphical bounds of this renderable string.
-
-
-
Method Detail
-
getString
public String getString()
Returns the string associated with this renderable string.- Returns:
- the string associated with this renderable string.
-
getFont
public Font getFont()
Returns the font associated with this renderable string.- Returns:
- the font associated with this renderable string.
-
getWidth
public int getWidth()
Returns the width of the graphical bounds of this renderable string.This method has the same specifications as
Font.stringWidth(String).- Returns:
- the width taken by this renderable string, in pixels.
-
getHeight
public int getHeight()
Returns the height of the graphical bounds of this renderable string.This method has the same specifications as
Font.getHeight().- Returns:
- the height taken by this renderable string, in pixels.
-
-