Surely you're all familiar with the Shogun title screen?

#1

You know, the one that looks like this?

I’ve been looking at Jon Ingold’s Title Page extension and I thought to myself, “surely we can get closer.”

So I got closer.

Pro:

  • Only redraws the bits that change – the actual menu list.

Con:

  • Glulx only
  • Not very extendable.

Slightly bad-in-places full code in the spoiler ↴

...it WAS a spoiler.
"Test" by Kawa

Include Basic Screen Effects by Emily Short.
Include Glulx Text Effects by Emily Short.
Include Flexible Windows by Jon Ingold.

Table of User Styles (continued)
style name	reversed	justification
special-style-1	true	--
special-style-2	false	center-justified

The splash-menu-window is a text-buffer g-window.
The main-window spawns the splash-menu-window.
The position of the splash-menu-window is g-placebelow.
The scale method of the splash-menu-window is g-fixed-size. The measurement of the splash-menu-window is 4.

The splash-prompt-window is a text-buffer g-window.
The splash-menu-window spawns the splash-prompt-window.
The position of the splash-prompt-window is g-placeleft.
The scale method of the splash-prompt-window is g-proportional. The measurement of the splash-prompt-window is 40.

The current splash option is a number that varies. The current splash option is 1.

Window-drawing rule for the splash-menu-window:
	 move focus to the splash-menu-window, clearing the window;
	 [This could be done better but so far, the output's good.]
	 say "[if the current splash option is 1][special-style-1][end if]START the game [roman type][line break]";
	 say "[if the current splash option is 2][special-style-1][end if]RESTORE a saved game [roman type][line break]";
	 say "[if the current splash option is 3][special-style-1][end if]QUIT the game [roman type][line break]";

Window-drawing rule for the splash-prompt-window:
	 move focus to the splash-prompt-window, clearing the window;
	 say "You may choose to:";

To show the splash screen:
	clear the screen;
	[I don't even know why I copypasted the Shogun credits here. Let's just claim demonstrative purposes.]
	say "[line break][special-style-2]SHOGUN[line break]A Story of Japan[line break]Copyright (c) 1988 by Infocom[line break]All rights reserved.[line break]SHOGUN is a trademark of James Clavell[line break]Original Literary Work Copyright 1975 by James Clavell[line break]Licensed by Noble House Trading Limited, London.[line break]Release 292 / Serial number 890314[line break]IBM Interpreter version 6.70[roman type]";
	shut down the status-window; 
	open up the splash-menu-window;
	open up the splash-prompt-window;
	while the splash-menu-window is g-present:
		follow the window-drawing rules for the splash-menu-window;
		let X be the chosen letter;
		if X is -6: [activate this selection]
			if the current splash option is:
				-- 1: shut down the splash-menu-window;
				-- 2:
					shut down the splash-menu-window;
					follow the restore the game rule;
					move focus to the main-window, clearing the window;
					try looking;
				-- 3: stop game abruptly;
		else if X is -4: [up]
			if the current splash option > 1:
				decrease the current splash option by 1;
			else:
				now the current splash option is 3;
		else if X is -5: [down]
			if the current splash option < 3:
				increase the current splash option by 1;
			else:
				now the current splash option is 1;
		else if X is -8 or X is 81 or X is 113: [select QUIT]
			now the current splash option is 3;
	open up the status-window;
	move focus to the main-window, clearing the window;

When play begins:
	show the splash screen;

The echo chamber is a room. "Something test-like about this place...".
#2

There’s definitely probably a way to get the black background and side banners using some of the extensions available.

(Erik Temple) #3

Yeah, it’s totally doable with Flexible Windows.

#4

It is, and I did. I didn’t include any side banners here because they’re a different puzzle that I’d solved pretty much the day Flexible Windows worked on the new Inform. Different, because they appear throughout the game, and are also in Zork Zero without the fancy title menu.

Code here
The current banner is a figure name that varies.
The current banner is initially the Figure of Banner_Stars.

The left-banner-window is a graphics g-window spawned by the main-window.
The position of the left-banner-window is g-placeleft.
The scale method of the left-banner-window is g-fixed-size.
The measurement of the left-banner-window is 64.

The right-banner-window is a graphics g-window spawned by the main-window.
The position of the right-banner-window is g-placeright.
The scale method of the right-banner-window is g-fixed-size.
The measurement of the right-banner-window is 64.

Window-drawing rule for the left-banner-window:
	clear the left-banner-window;
	[Shogun and Zork Zero had fixed screen heights so they could draw their banners
	just once each. We don't have that luxury.]
	let H be the height of the left-banner-window;
	let Y be 0;
	while Y < H:
		draw a copy of the current banner in the left-banner-window at 0 by Y;
		increase Y by 256;
		[assumes the banner is 256 pixels high for cheapness even though there
		are perfectly usable image size routines...]

[Drawing two distinct sides is left as an exercise for the reader.]
Window-drawing rule for the right-banner-window:
	clear the right-banner-window;
	let H be the height of the right-banner-window;
	let Y be 0;
	while Y < H:
		draw a copy of the current banner in the right-banner-window at 0 by Y;
		increase Y by 256;

Which does bring up the issue of the user resizing the window. Text windows look fine, but the banners show ugly white areas. I… solve this by redrawing every turn, but that only fixes it temporarily.