Package tripleplay.util
Class StyledText
java.lang.Object
tripleplay.util.StyledText
- Direct Known Subclasses:
StyledText.Plain
Manages styled text. This comes in many flavors: a single line of plain (uniformly styled) text,
multiple lines of plain text, and (coming soon) multiple lines of rich (non-uniformly styled)
text.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Multiple lines of plain (uniformly styled) text.static class
A shared base class for single- and multi-line plain text.static class
A single line of plain (uniformly styled) text. -
Method Summary
Modifier and TypeMethodDescriptionstatic StyledText.Block
Creates a uniformly formatted multiple-lines of text wrapped atwrapWidth
and left-aligned.abstract float
height()
The height of this styled text when rendered.abstract void
Renders this styled text into the supplied canvas at the specified offset.static StyledText.Span
Creates a uniformly formatted single-line of text.toCanvas()
Creates a canvas large enough to accommodate this styled text, and renders it therein.toLayer()
Creates an image large enough to accommodate this styled text, renders it therein and returns an image layer with its translation adjusted per the effect renderer.abstract ImageLayer
toLayer
(ImageLayer target) Creates an image large enough to accommodate this styled text, renders it therein and applies it tolayer
, adjusting its translation per the effect renderer.abstract float
width()
The width of this styled text when rendered.
-
Method Details
-
span
Creates a uniformly formatted single-line of text. -
block
Creates a uniformly formatted multiple-lines of text wrapped atwrapWidth
and left-aligned. -
width
public abstract float width()The width of this styled text when rendered. -
height
public abstract float height()The height of this styled text when rendered. -
render
Renders this styled text into the supplied canvas at the specified offset. -
toCanvas
Creates a canvas large enough to accommodate this styled text, and renders it therein. The canvas will include a one pixel border beyond the size of the styled text which is needed to accommodate antialiasing. -
toLayer
Creates an image large enough to accommodate this styled text, renders it therein and returns an image layer with its translation adjusted per the effect renderer. -
toLayer
Creates an image large enough to accommodate this styled text, renders it therein and applies it tolayer
, adjusting its translation per the effect renderer.
-