AGI Command Reference - Sound Resource Management Commands and AGI Command Reference - Text Management Commands: Difference between pages

From Sierra Wiki
(Difference between pages)
Jump to navigationJump to search
m 1 revision imported
 
sierraw>Andrew Branscom
 
Line 22: Line 22:
</div><br />
</div><br />


<div align="center"><span style="font-size: 22pt">Sound Resource Management Commands</span><br />
<div align="center"><span style="font-size: 22pt">Text Management Commands</span><br />
''By [[agiw:Chris Cromer|Chris Cromer]]''</div>
''By [[agiw:Chris Cromer|Chris Cromer]]''</div>


&nbsp;
&nbsp;


== <br />load.sound(n); ==
== <br />prevent.input(); ==


<blockquote>
<blockquote>Prevents the user from entering anything using the keyboard.</blockquote>
Loads into memory the SOUND resource number n, i.e. Sound(n). Note that there is no way of loading a sound with indirection. The command <code>load.sound.v</code> does not exist.
 
</blockquote>
== accept.input(); ==
 
<blockquote>Allows the user to enter text using the keyboard.</blockquote>
 
== print(n); print.v(n); ==
 
<blockquote>Opens a text window in the center of the screen, where a message number n (or Var(n)) from the messages field of the current Logic resource is displayed. Output mode is determined by Flag(15).
The message is a NULL-terminated string of text. In addition to letters, digits, and other symbols, the string may contain:<br />
<br />
* Newline character (0Ah);
* Format element:
** %v - at this place the output will include a decimal value of variable with the given number.
** %m - the text of the message with the given number is inserted at this place.
** %0 - the name of the item with the given number is inserted at this place.
** %w - a vocabulary word with the given number is inserted at this place.
** %s - a string variable with the given number is inserted at this place.
** %g - a message with this number from message field of Logic(0) is inserted at this place.<br />
<br />
For v format, you can add a vertical line and a number of characters the output should take. In this case leading zeros are not suppressed in the output. Example: %v34 | 2 When you write your messages, remember that the interpreter wraps the text between the lines as needed when the message is displayed.</blockquote>
 
== display(R, C, N); display.v(R, C, N); ==
 
<blockquote>Prints a message number N (Var(N)) in the row R (Var(R)), starting with the column C (Var(C)). No window is created, so it is up to the programmer to erase the output when it is no longer needed.</blockquote>
 
== print.at(n, x, y, l); print.at.v(n, x, y, l); ==
 
<blockquote>Analogous to print but the programmer can specify the window location. x, y, and l are constants specifying coordinates of the top left corner of the window and its width in character cells of a 40x25 screen.</blockquote>
 
== version(); ==
 
<blockquote>Prints interpreter version in the center of the screen.</blockquote>
 
== text.screen(); ==
 
<blockquote>The screen switches to the text mode 40x25.</blockquote>
 
== graphics(); ==
 
<blockquote>The screen returns to the graphics mode. The picture on the screen is restored.</blockquote>
 
== set.cursor.char(n); ==
 
<blockquote>First byte of the message n is user as a text mode cursor.</blockquote>
 
== set.text.attribute(F, B); ==
 
<blockquote>Sets foreground and background colors for display, get_num, and get_string commands.</blockquote>
 
== clear.lines(n, m, C); ==
 
<blockquote>Clears text lines from n to m using color C.</blockquote>
 
== clear.text.rect(x1, y1, x2, y2, C); ==
 
<blockquote>Clears a rectangular area with top left corner coordinates (x1,y1) and bottom right coordinates (x2,y2) using color C.</blockquote>


== sound(n, m); ==
== status.line.on(); ==


<blockquote>Starts playback of the SOUND resource number n. When finished, Flag(m) is set to 1.</blockquote>
<blockquote>Shows the status line containing the current score and sound status (on/off).</blockquote>


== stop.sound(); ==
== status.line.off(); ==


<blockquote>
<blockquote>
Stops the playback.
Removes the status line.
</blockquote>  
</blockquote>  


Line 75: Line 129:
[[AGI Command Reference|AGI Command Reference Index]]
[[AGI Command Reference|AGI Command Reference Index]]


<span style="float: left">[[AGI Command Reference - Picture Resource Management Commands|&lt; Previous: Picture Resource Management Commands]]</span><span style="float: right">[[AGI Command Reference - Text Management Commands|Next: Text Management Commands &gt;]]</span>
<span style="float: left">[[AGI Command Reference - Sound Resource Management Commands|&lt; Previous: Sound Resource Management Commands]]</span><span style="float: right">[[AGI Command Reference - String Management Commands|Next: String Management Commands &gt;]]</span>


&nbsp;
&nbsp;
Line 84: Line 138:
[[Category:AGI Logic]]
[[Category:AGI Logic]]
[[Category:AGI Commands]]
[[Category:AGI Commands]]
[[Category:AGI Sound Resources]]

Revision as of 21:16, 30 January 2022

AGI Command Reference Index

Page: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16


Text Management Commands
By Chris Cromer

 


prevent.input();

Prevents the user from entering anything using the keyboard.

accept.input();

Allows the user to enter text using the keyboard.

print(n); print.v(n);

Opens a text window in the center of the screen, where a message number n (or Var(n)) from the messages field of the current Logic resource is displayed. Output mode is determined by Flag(15).

The message is a NULL-terminated string of text. In addition to letters, digits, and other symbols, the string may contain:

  • Newline character (0Ah);
  • Format element:
    • %v - at this place the output will include a decimal value of variable with the given number.
    • %m - the text of the message with the given number is inserted at this place.
    • %0 - the name of the item with the given number is inserted at this place.
    • %w - a vocabulary word with the given number is inserted at this place.
    • %s - a string variable with the given number is inserted at this place.
    • %g - a message with this number from message field of Logic(0) is inserted at this place.


For v format, you can add a vertical line and a number of characters the output should take. In this case leading zeros are not suppressed in the output. Example: %v34 | 2 When you write your messages, remember that the interpreter wraps the text between the lines as needed when the message is displayed.

display(R, C, N); display.v(R, C, N);

Prints a message number N (Var(N)) in the row R (Var(R)), starting with the column C (Var(C)). No window is created, so it is up to the programmer to erase the output when it is no longer needed.

print.at(n, x, y, l); print.at.v(n, x, y, l);

Analogous to print but the programmer can specify the window location. x, y, and l are constants specifying coordinates of the top left corner of the window and its width in character cells of a 40x25 screen.

version();

Prints interpreter version in the center of the screen.

text.screen();

The screen switches to the text mode 40x25.

graphics();

The screen returns to the graphics mode. The picture on the screen is restored.

set.cursor.char(n);

First byte of the message n is user as a text mode cursor.

set.text.attribute(F, B);

Sets foreground and background colors for display, get_num, and get_string commands.

clear.lines(n, m, C);

Clears text lines from n to m using color C.

clear.text.rect(x1, y1, x2, y2, C);

Clears a rectangular area with top left corner coordinates (x1,y1) and bottom right coordinates (x2,y2) using color C.

status.line.on();

Shows the status line containing the current score and sound status (on/off).

status.line.off();

Removes the status line.


References



Related Links

 

Page: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16


AGI Command Reference Index

< Previous: Sound Resource Management CommandsNext: String Management Commands >