Configure.screen
The configure.screen command sets the location of the play area (visual graphic screen), input line and status line.
Syntax
configure.screen(byt PLAYTOP, byt INPUTLINE, byt STATUSLINE);
Remarks
If the configure.screen command is not called at all, the default values for PLAYTOP, INPUTLINE and STATUSLINE are 0, 21, 23 respectively.
The units for the three arguments are in screen lines (0 -24 range).
PLAYTOP is the top line of the playing area (the actual background picture). The default value is 0, but it is usually set to 1. If it is left at 0, the menu bar (which cannot be moved) will cover up the first eight rows of pixels.
The input line location is set by INPUTLINE. The default position is row 23, and most Sierra games put the input line at the bottom of the screen, sometimes on row 24.
The default position of the status line is row 21, just below the background picture. Most Sierra games used a value of 0, so the status line would show on the same row that the menu bar is on. Note that the menu bar cannot be moved; it will always display on line 0.
The screen configuration does not need to be set in each room. The location of the play area, status line and input line will not change unless another call to configure.screen is made.
If the playing area location is changed while a picture is currently being displayed, AGI does not erase the existing picture; it will draw the picture at the new location, and there will be portions of the previous picture visible above or below the current picture. Use the clear.lines or clear.text.rect to clear those unwanted areas.
Possible Errors
PLAYTOP should always be set to something between 0 and 3, since the playing area is 168 pixels high (21 lines). Setting it to 4 or higher will result in portions of the playing area being off screen with unpredictable graphical output.
The input line does not immediately change location when configure.screen is run. This is because configure.screen does not change the current cursor location; it only changes the stored value that AGI uses to reset the input line. The cursor location is adjusted to match the value of the input line when the line is redrawn after a player presses ENTER or when a new.room or graphics command is encountered.
The input line location is also accessed by several other commands, including accept.input, prevent.input, echo.line, and get.num. If you change the location of the input line using the configure.screen command, these commands will not work properly, because the cursor and input line location will not match.
Avoid using values for these arguments that result in either the input line or status line being displayed inside the play area. The results will be unpredictable. Also, avoid using values greater than 24 for input line or status line; if you do, the screen will not display correctly due to buffer overflows in the functions where AGI draws the input line and status line.
Example
<syntaxhighlight lang="agi"> configure.screen(1, 22, 0); [ typical configuration with status line
[ on top and input line on bottom
</syntaxhighlight>
Technical Information
Required Interpreter Version: | Available in all AGI versions. |
Byte-Code Value: | 111 (0x6F hex) |