1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-07-16 14:04:24 +03:00
inform7/resources/Documentation/Examples/CornerOfNoAndWhere.txt

43 lines
1.2 KiB
Plaintext
Raw Normal View History

Example: * Corner of No and Where
Location: Longer extracts of Inform 6 code
RecipeLocation: The Status Line
Index: Status line with centered text, the hard way
Description: A status line which has only the name of the location, centered.
For: Z-Machine
2019-02-05 02:44:07 +02:00
Making major changes to display features, such as the construction of the status line, sometimes requires that we rely on Inform 6 in bulk; here is how we might produce the Trinity-style status line, with the location centered at the top center of the screen.
{*}"Corner of No and Where"
2019-02-05 02:44:07 +02:00
No is a room. Where is west of No.
2019-02-05 02:44:07 +02:00
Rule for constructing the status line:
print the location in the center of the status line;
rule succeeds.
2019-02-05 02:44:07 +02:00
To print the location in the center of the status line:
(- PrintCenteredStatus(); -).
Include (-
Array printed_text --> 64;
[ PrintCenteredStatus i j;
@set_cursor 1 0;
i = 0->33;
spaces(i);
@output_stream 3 printed_text;
print (name) location;
@output_stream -3;
j = (i - (printed_text-->0))/2;
@set_cursor 1 j;
print (name) location;
spaces j-1;
2019-02-05 02:44:07 +02:00
];
-)
2019-02-05 02:44:07 +02:00
Test me with "w / e".
In fact, as we've already seen, many extra modifications to the display behavior are possible using Basic Screen Effects.