Message text: Difference between revisions

From Wiki of ZZT
Jump to navigation Jump to search
mNo edit summary
No edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
<blockquote>''This article is about written text displayed on-screen. For messages sending ZZT-OOP objects to specific labels, see [[Label]].''</blockquote>
All lines of ZZT-OOP which do not have any matching prefix are considered to be '''message text'''.
All lines of ZZT-OOP which do not have any matching prefix are considered to be '''message text'''.


Throughout the execution of code, these lines are collected, and after the object's cycle is complete, they are displayed:
Throughout the execution of code, these lines are collected, and after the object's cycle is complete, they are displayed:


* If only one line was collected, it is displayed on the bottom of the board as a message.
* If only one line was collected, it is displayed on the bottom of the board as a message (provided a [[message timer]] can be spawned).
* If more than one line was collected, it is displayed in a pop-up [[Text window|text window]].
* If more than one line was collected, it is displayed in a pop-up [[Text window|text window]].
** In this case, lines prefixed with <code>$</code> are displayed centered and in white, while lines without such a prefix are displayed left-aligned and in yellow.
** In this case, lines prefixed with <code>$</code> are displayed centered and in white, while lines without such a prefix are displayed left-aligned and in yellow.


Message text has an implicit length limit of '''50''' characters per line. However, text windows can only display up to '''42''' characters per line without creating visual glitches; of those, one character eats into the arrow padding, so for proper centering, '''41''' characters should be assumed.
Message text has an implicit length limit of '''50''' characters per line. However, text windows can only display up to '''42''' characters per line without creating visual glitches; of those, one character eats into the arrow padding, so for proper centering, '''41''' characters should be assumed.
Text can be displayed conditionally (e.g. <code>#if foo "Hello."</code>) if the text string does not begin with an alphabetic character (A-Z, a-z) or a ZZT-OOP prefix.


{{ZZT-OOP navbox}}
{{ZZT-OOP navbox}}

Latest revision as of 08:38, 26 December 2025

This article is about written text displayed on-screen. For messages sending ZZT-OOP objects to specific labels, see Label.

All lines of ZZT-OOP which do not have any matching prefix are considered to be message text.

Throughout the execution of code, these lines are collected, and after the object's cycle is complete, they are displayed:

  • If only one line was collected, it is displayed on the bottom of the board as a message (provided a message timer can be spawned).
  • If more than one line was collected, it is displayed in a pop-up text window.
    • In this case, lines prefixed with $ are displayed centered and in white, while lines without such a prefix are displayed left-aligned and in yellow.

Message text has an implicit length limit of 50 characters per line. However, text windows can only display up to 42 characters per line without creating visual glitches; of those, one character eats into the arrow padding, so for proper centering, 41 characters should be assumed.

Text can be displayed conditionally (e.g. #if foo "Hello.") if the text string does not begin with an alphabetic character (A-Z, a-z) or a ZZT-OOP prefix.