mirror of
https://github.com/ganelson/inform.git
synced 2024-07-08 01:54:21 +03:00
46 lines
1.4 KiB
Plaintext
46 lines
1.4 KiB
Plaintext
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
|
|
|
|
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.
|
|
|
|
Note that this example _only_ works if the Settings for it are set to the Z-machine story file format: it does not work on the default Glulx setting, which has a different screen arrangement.
|
|
|
|
{*}"Corner of No and Where"
|
|
|
|
No is a room. Where is west of No.
|
|
|
|
Rule for constructing the status line:
|
|
print the location in the center of the status line;
|
|
rule succeeds.
|
|
|
|
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;
|
|
];
|
|
|
|
-)
|
|
|
|
Test me with "w / e".
|
|
|
|
In fact, as we've already seen, many extra modifications to the display behaviour are possible using Basic Screen Effects.
|
|
|