Package tripleplay.util
Class StyledText.Block
java.lang.Object
tripleplay.util.StyledText
tripleplay.util.StyledText.Plain
tripleplay.util.StyledText.Block
- Enclosing class:
StyledText
Multiple lines of plain (uniformly styled) text.
-
Nested Class Summary
Nested classes/interfaces inherited from class tripleplay.util.StyledText
StyledText.Block, StyledText.Plain, StyledText.Span
-
Field Summary
Modifier and TypeFieldDescriptionfinal TextBlock.Align
The alignment of wrapped text, unused if not wrapping.final float
Additional space to be added (or subtracted) from the default line spacing.final TextWrap
The text wrap configuration, unused if not wrapping.Fields inherited from class tripleplay.util.StyledText.Plain
style, text
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
int
hashCode()
float
height()
The height of this styled text when rendered.void
Renders this styled text into the supplied canvas at the specified offset.resize
(float size) Creates a new instance equivalent to this one excepting that the font size is adjusted tosize
.toString()
float
width()
The width of this styled text when rendered.Methods inherited from class tripleplay.util.StyledText.Plain
toLayer
Methods inherited from class tripleplay.util.StyledText
block, span, toCanvas, toLayer
-
Field Details
-
wrap
The text wrap configuration, unused if not wrapping. -
align
The alignment of wrapped text, unused if not wrapping. -
lineSpacing
public final float lineSpacingAdditional space to be added (or subtracted) from the default line spacing.
-
-
Constructor Details
-
Block
public Block(Graphics gfx, String text, TextStyle style, TextWrap wrap, TextBlock.Align align, float lineSpacing)
-
-
Method Details
-
width
public float width()Description copied from class:StyledText
The width of this styled text when rendered.- Specified by:
width
in classStyledText
-
height
public float height()Description copied from class:StyledText
The height of this styled text when rendered.- Specified by:
height
in classStyledText
-
render
Description copied from class:StyledText
Renders this styled text into the supplied canvas at the specified offset.- Specified by:
render
in classStyledText
-
resize
Description copied from class:StyledText.Plain
Creates a new instance equivalent to this one excepting that the font size is adjusted tosize
. This is useful for auto-shrinking text to fit into fixed space.- Specified by:
resize
in classStyledText.Plain
-
hashCode
public int hashCode()- Overrides:
hashCode
in classStyledText.Plain
-
equals
- Overrides:
equals
in classStyledText.Plain
-
toString
-