GameMaker Touhou Engine   Home   Downloads   Documentation


A script that draws a formatted string onto the screen.

Returns: Void


_DRAW_MARKUP_STRING(_x, _y, fnt, str, alpha)


Name Value Significance
_x <integer> The X-coordinate to draw the text at.
_y <integer> The Y-coordinate to draw the text at.
fnt <font> The font to use.
str <string> The text to draw.
alpha <real(0-1)> The alpha value of the drawn text.

Formatting Text:

The string that is drawn to the screen can contain special tags that make formatting easier:

@@ Output an "@" symbol.
@# Output a "#" symbol.
@[n] Move to the next line.
@[d] Output all of the text inside the buffer. (if you wish to change colors mid-line, put this tag before the color tag)
@[c_<color>] Change the color of the text. <color> can be a default GML color (green, black, fuchsia etc, case sensitive) or a hexadecimal color code. The default text color is black.

The tags don't need to be separated from the text via whitespaces, and anything after an "@" symbol that isn't listed in the above table will be ignored until an "]" character is encountered.


Iterate through the given string and place characters inside a buffer, outputting them when a newline or "d" tag is encountered using _DRAW_TEXT_BORDER() with black borders.
Use draw_set_color() to change the color when the corresponding tag is encountered. For an example usage, see the last step of the timeline _STAGE_SEQ_STAGE1_SHALF.