Message Row

From MZXWiki
Revision as of 14:49, 25 January 2011 by Kuroneko (talk | contribs)
Jump to navigation Jump to search

The Message Row is an incredibly simple yet powerful tool for displaying strings and values on the screen. Activating the message line only requires a single line of code, which must be repeated every cycle to keep the displayed data current. As of Megazeux 2.83, the message line can consist of 512 characters.

* "This line of text will be displayed on the Message Row!"

By default, the message line command causes the text to appear centered on the bottom row, while the forground color of the text is animated by cycling through various colors of the palette. Also, the message line will only be displayed for a short period, unless a new message is created. Lastly, built-in objects can also use the message line to display their own messages, which could potentially overwrite important information that we want to communicate to the player. Fortunately, we can adjust these defaults with a few commands and some special formatting.

Commands

* "string" Displays text in the message row.
MESSAGE ROW # Sets the row in which the message row appears in
SET MESG COLUMN # Sets the column in which the message row appears in, and disables auto-centering
CENTER MESG Enables auto-centering of the message row.
DISABLE MESG EDGE Disables the single-char edge that is placed on each side of the message row by default
ENABLE MESG EDGE Enables the edge on the message row.  Enabled by default.
CLEAR MESG Turns the message row off.

Counters

The global counter BIMESG can be used to disable/enable built-in messages

Special Formatting

You can also adjust the appearance of the text through the special prefixes ~ and @ followed by a hexadecimal digit for the color.

* "~FThis text is white on black. ~eThis text is yellow on black. @1This text is yellow on dark blue."

The message row will also interpret the new line character, \n, and display any text that follows on the next row. The newline character can be used as many times as needed, as long as it doesn't extend past the bottom row of the screen.

You can also display values stored inside of counters, and even expressions, through counter interpolation.

set "$string" to "Five minus four equals "
set "num" to 4
* "~f&$string&(5-'num')"