GOOC - Game Oriented Object C
GOOC - Game Oriented Object C
12.4. Text Animations
12.4. Text Animations
Text animations describe a set of strings, which can include the standard specifiers like %d and a few custom ones like ~n. Unlike other animations which use sprites, text animations can be colored at will using the object's four color vectors, one for each vertex of every single character of the string, though text animations are slower to process and take up more memory. Text animations are type 4.
The format for a font animation is as follows:
#text anim-name font-name tpag-eid
anim-name is an identifier for the animation's name. font-name is the name of a previously defined font that will be used by the text display. tpag-eid is the EID of the texture page that contains the sprite(s).
This is then followed by a list of text strings:
"STRING 1"
"STRING 2"
"STRING~n%d"
Each string ends with a null terminator character (\0) and can have up to 4 individual format specifiers (beginning with %); they are processed with a call to sprintf, with 4 corresponding arguments the 1st, 2nd, 3rd, and 4th words, respectively, before (or below) the top of the object's stack.
These strings can also contain several types of extended format specifiers. These begin with a tilde ~ and can be specified as one of the following:
Specifier | Output/Function |
~n | Newline. |
~% | Newline. |
~c0 | Disable shading (object's color vectors will not affect proceeding chars). |
~c1 | Enable shading (object's color vectors will affect proceeding chars). |
~p# | Skips the following character if the value at in #th word before/below the top of the object's stack is 1. Used to auto change from singular to plural forms of the noun(s) introduced by the corresponding cardinal determiner (i.e. 1 'box' to n 'boxes' for n != 1). |
~sx####~ | Set width of following characters to # (min 1, max 4 digits). |
~sy####~ | Set height of following characters to # (min 1, max 4 digits). |
If flag 0x4000000 in statusb is set, the text will have a black backdrop. If flag 0x400 in statusb is set, the text will be center-aligned.