Display.v

From AGI Wiki
Jump to navigationJump to search

The display.v command indirectly displays text at a specified row and column.

Syntax

display.v(var vROW, var vCOL, var vMSG);

Remarks

This command takes a variables as arguments. Use the display command display text using numbers as arguments.

The text of the message with the number in vMSG is displayed at row and column given by the values in vROW and vCOL respectively, using the background and foreground colors set by the most recent set.text.attribute command. Note that unlike the print commands, the display.v command does not include a border around the message text.

The display.v command is mostly used on the text screen. Typical uses for the text screen are to display help screens, or passages of text from in game items such as books, letters, etc.

The display.v command will also display text messages on the graphics screen. Care must be taken in this case, because the text does not automatically clear. Also, if a screen object moves over the displayed text, the text will be erased pixel by pixel as the the object moves past. The programmer should take care to be sure the displayed text will not be accidentally erased by moving objects.

A typical use of the display.v command on the graphics screen is to add text to credit screens, or maybe to provide changing text on signs or such.

Possible Errors

If you pass a row value greater than 24, your text will not display at all. If you pass a column value greater than 39, the first character of the display message will be placed slightly below the desired vROW value, with a vertical offset in pixels equal to INT(vCOL/40), in a column equal to the vCOL value MOD 40, and the rest of the display message will be left aligned, one row below the desired vROW value.

Example

Code:

<syntaxhighlight lang="agi">text.screen(); [ change to text screen so we can use all colors set.text.attribute(3,0); [ cyan text on black background v50 = 6; v51 = 10; v52 = 1; [ message 1 = "Burma Shave" display.v(v50, v51, v52); </syntaxhighlight>

Technical Information

Required Interpreter Version: Available in all AGI versions.
Byte-Code Value: 104 (0x68 hex)

See Also

display
set.text.attribute