Message Line: Difference between revisions

From MZXWiki
Jump to navigation Jump to search
m (it is called "Message Line" oops)
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
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.
The [[Message Line]] 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!"
  * "This line of text will be displayed on the Message Line!"


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.
By default, the message line command causes the text to appear centered on the bottom row, while the foreground 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==
==Commands==
* "string" ''Activates the message row for a given period of time and displays text.
'''[[* "string"]]'''
    Subsequent * commands while the message row is still active replace the displayed text,
 
    making it useful for animations or status bars.''
'''[[* "string"#CLEAR MESG|CLEAR MESG]]'''
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''
'''[[MESSAGE ROW (command)|MESSAGE ROW #]]'''
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''
'''[[MESSAGE ROW (command)|SET MESG COLUMN #]]'''
ENABLE MESG EDGE ''Enables the edge on the message row.  Enabled by default.''
 
CLEAR MESG ''Turns the message row off.''
'''[[MESSAGE ROW (command)|CENTER MESG]]'''
 
'''[[* "string"#DISABLE MESG EDGE|DISABLE MESG EDGE]]'''
 
'''[[* "string"#ENABLE MESG EDGE|ENABLE MESG EDGE]]'''


==Counters==
==Counters==


The global counter BIMESG can be used to disable/enable built-in messages
The global counter BIMESG can be used to disable/enable built-in messages, such as the ones displayed when the player is hit by built-in bullets or switches bomb types.


==Special Formatting==
==Special Formatting==
Line 26: Line 30:
  * "~FThis text is white on black. ~eThis text is yellow on black. @1This text is yellow on dark blue."
  * "~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.  
The message line 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]].
You can also display values stored inside of counters, and even expressions, through [[counter interpolation]].
Line 33: Line 37:
  set "num" to 4
  set "num" to 4
  * "~f&$string&(5-'num')"
  * "~f&$string&(5-'num')"
==Message Line HUDs vs Overlay and Sprite HUDs==
+ The message line is static to the [[viewport]], as opposed to the Write/Copy Overlay commands
+ Unlike the message line, the overlay requires some clean-up if the board is allowed to scroll, or displays data that can be of varying length (like counter values).
- The robotic editor isn't designed to display ~ and @ color prefixes; As a result, scripting the message line to display graphical data can be cumbersome and error prone.
- Unlike the overlay and sprite layers, the background color of a message line will never change to what color is below it.
[[Category:MegaZeux]]

Latest revision as of 02:19, 29 May 2025

The Message Line 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 Line!"

By default, the message line command causes the text to appear centered on the bottom row, while the foreground 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"

CLEAR MESG

MESSAGE ROW #

SET MESG COLUMN #

CENTER MESG

DISABLE MESG EDGE

ENABLE MESG EDGE

Counters

The global counter BIMESG can be used to disable/enable built-in messages, such as the ones displayed when the player is hit by built-in bullets or switches bomb types.

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 line 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')"

Message Line HUDs vs Overlay and Sprite HUDs

+ The message line is static to the viewport, as opposed to the Write/Copy Overlay commands

+ Unlike the message line, the overlay requires some clean-up if the board is allowed to scroll, or displays data that can be of varying length (like counter values).

- The robotic editor isn't designed to display ~ and @ color prefixes; As a result, scripting the message line to display graphical data can be cumbersome and error prone.

- Unlike the overlay and sprite layers, the background color of a message line will never change to what color is below it.