Package tripleplay.util
Class TextStyle
java.lang.Object
playn.core.TextFormat
tripleplay.util.TextStyle
Describes everything needed to style a particular run of text.
-
Field Summary
Modifier and TypeFieldDescriptionstatic TextStyle
A default text style from which custom styles can be derived.final EffectRenderer
The text effect used when rendering the text.final int
The color used to render the text.final boolean
Whether or not the text is underlined.Fields inherited from class playn.core.TextFormat
antialias, font
-
Constructor Summary
ConstructorDescriptionTextStyle
(Font font, boolean antialias, int textColor, EffectRenderer effect, boolean underlined) Creates a text style with the specified configuration. -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
hashCode()
static TextStyle
Creates a text style with the specified configuration using default anti-aliasing, no effect and no underline.static TextStyle
normal
(Font font, int textColor, EffectRenderer effect) Creates a text style with the specified configuration using default anti-aliasing (true) and no underline.withAntialias
(boolean antialias) withEffect
(EffectRenderer effect) Returns a copy of this text style with the effect configured aseffect
.withOutline
(int outlineColor) Returns a copy of this text style with a pixel outline text effect.withOutline
(int outlineColor, float outlineWidth) Returns a copy of this text style with a vector outline text effect.withShadow
(int shadowColor, float shadowX, float shadowY) Returns a copy of this text style with a shadow text effect.withTextColor
(int textColor) Returns a copy of this text style with the color configured astextColor
.withUnderline
(boolean underlined) Returns a copy of this text style with (or without) underlining.Methods inherited from class playn.core.TextFormat
toString, withFont, withFont
-
Field Details
-
DEFAULT
A default text style from which custom styles can be derived. -
textColor
public final int textColorThe color used to render the text. -
effect
The text effect used when rendering the text. -
underlined
public final boolean underlinedWhether or not the text is underlined.
-
-
Constructor Details
-
TextStyle
public TextStyle(Font font, boolean antialias, int textColor, EffectRenderer effect, boolean underlined) Creates a text style with the specified configuration.
-
-
Method Details
-
normal
Creates a text style with the specified configuration using default anti-aliasing, no effect and no underline. -
normal
Creates a text style with the specified configuration using default anti-aliasing (true) and no underline. -
withFont
- Overrides:
withFont
in classTextFormat
-
withAntialias
- Overrides:
withAntialias
in classTextFormat
-
withTextColor
Returns a copy of this text style with the color configured astextColor
. -
withEffect
Returns a copy of this text style with the effect configured aseffect
. -
withShadow
Returns a copy of this text style with a shadow text effect. -
withOutline
Returns a copy of this text style with a pixel outline text effect. -
withOutline
Returns a copy of this text style with a vector outline text effect. -
withUnderline
Returns a copy of this text style with (or without) underlining. -
hashCode
public int hashCode()- Overrides:
hashCode
in classTextFormat
-
equals
- Overrides:
equals
in classTextFormat
-