jjTEXTAPPEARANCE class by value JJ2+

Layout and styling options for drawn text

Passed to jjCANVAS::drawString(), jjDrawString() and jjGetStringWidth() to control spacing, alignment, movement of the letters and how special characters are treated. Text in one of the built-in sizes uses only spacing, align, newline and whether xAmp or yAmp are non-zero; text drawn with a font animation uses spacing, align and the treatment of the special characters.

Constructors

jjTEXTAPPEARANCE()
Creates a default appearance
jjTEXTAPPEARANCE(STRING::Mode mode)
Creates an appearance that matches a STRING::Mode

Operators

jjTEXTAPPEARANCE& opAssign(STRING::Mode other) =
Applies the settings of a STRING::Mode

Properties

STRING::Alignment align
Horizontal alignment of the text
STRING::SignTreatment at partially supported
Treatment of the @ character
STRING::SignTreatment caret partially supported
Treatment of the ^ character
STRING::SignTreatment hash partially supported
Treatment of the # character
bool monospace partially supported
Whether every character takes the same width (currently ignored)
STRING::SignTreatment newline
Treatment of the line feed character
STRING::SignTreatment pipe partially supported
Treatment of the | character
STRING::SignTreatment section partially supported
Treatment of the § character
bool skipInitialHash partially supported
Whether a # at the very start of the text is left out (currently ignored)
int spacing
Spacing between characters in pixels
STRING::SignTreatment tilde partially supported
Treatment of the ~ character
int xAmp partially supported
Horizontal movement of the letters
int yAmp partially supported
Vertical movement of the letters

Constructor documentation

jjTEXTAPPEARANCE::jjTEXTAPPEARANCE()

Creates a default appearance

Spacing is 1, the letters don't move, alignment is DEFAULT and every special character is hidden.

jjTEXTAPPEARANCE::jjTEXTAPPEARANCE(STRING::Mode mode)

Creates an appearance that matches a STRING::Mode

Spacing is 1. RIGHTALIGN aligns the text to the right, BOUNCE sets yAmp, and SPIN sets both amplitudes and lets line feeds start new lines. Everything else is as in the default appearance.

Operator documentation

jjTEXTAPPEARANCE& jjTEXTAPPEARANCE::opAssign(STRING::Mode other) =

Applies the settings of a STRING::Mode

Sets spacing, xAmp, yAmp, align and newline as the constructor taking a mode does, other properties keep their values.

Property documentation

STRING::Alignment jjTEXTAPPEARANCE::align

Horizontal alignment of the text

LEFT, CENTER and RIGHT align the text against the given x coordinate. With DEFAULT, the x coordinate itself selects the alignment on the HUD: below 0x4000 the text starts there, from 0x4000 it is centered on the screen and shifted by xPixel - 0x8000, and from 0xC000 its right side is aligned to the right edge, moved left by xPixel - 0x10000.

STRING::SignTreatment jjTEXTAPPEARANCE::at

Treatment of the @ character

With STRING::DISPLAYSIGN it is drawn as a regular character, otherwise it starts a new line. Applies to text drawn with a font animation.

STRING::SignTreatment jjTEXTAPPEARANCE::caret

Treatment of the ^ character

With STRING::DISPLAYSIGN it is drawn as a regular character, otherwise it is left out. Applies to text drawn with a font animation.

STRING::SignTreatment jjTEXTAPPEARANCE::hash

Treatment of the # character

With STRING::DISPLAYSIGN it is drawn as a regular character, otherwise it is left out. Applies to text drawn with a font animation.

bool jjTEXTAPPEARANCE::monospace

Whether every character takes the same width (currently ignored)

STRING::SignTreatment jjTEXTAPPEARANCE::newline

Treatment of the line feed character

For text in a built-in size, STRING::SPECIALSIGN makes \n start a new line. Text drawn with a font animation always breaks lines at it.

STRING::SignTreatment jjTEXTAPPEARANCE::pipe

Treatment of the | character

With STRING::DISPLAYSIGN it is drawn as a regular character, otherwise it is left out. Applies to text drawn with a font animation.

STRING::SignTreatment jjTEXTAPPEARANCE::section

Treatment of the § character

With STRING::DISPLAYSIGN it is drawn as a regular character, otherwise it is left out. Applies to text drawn with a font animation.

bool jjTEXTAPPEARANCE::skipInitialHash

Whether a # at the very start of the text is left out (currently ignored)

int jjTEXTAPPEARANCE::spacing

Spacing between characters in pixels

Added after each character. Defaults to 1.

STRING::SignTreatment jjTEXTAPPEARANCE::tilde

Treatment of the ~ character

With STRING::DISPLAYSIGN it is drawn as a regular character, otherwise it is left out. Applies to text drawn with a font animation.

int jjTEXTAPPEARANCE::xAmp

Horizontal movement of the letters

For text in a built-in size, a non-zero value together with a non-zero yAmp makes the letters spin in place.

int jjTEXTAPPEARANCE::yAmp

Vertical movement of the letters

For text in a built-in size, a non-zero value makes the letters bounce up and down (or spin, if xAmp is non-zero too).