Lesson 2: Where we learn about changing a windows attributes
Okay, so we've got a window under our belts--let's mess with it.
But first off, let's just mention the obvious--to put comments in a file, you can just put two foreslashes // and the rest of the text on that line is ignored. (Programmers, you can also comment off sections of code by putting /* */ around them.)
Okay, that said, we'll move on.
Let's look at all the commands you can use to change the way a window looks, and then how we can get fancier with the text in a window.
Here's our window:
#window 2:1 using the "trash" bank number of 2
These commands can appear in any order in a window.
This is the name of the window border/graphic composite to use for this window You can find styles in the \anoxdata\graphics\interface\windows\ directory. The most commonly used style in Anachronox is "style_embrace"
style "NULL"So the program will know there is no border.
You can find fonts in the \anoxdata\graphics\fonts directory.
This specifies what background graphic to use. It can be a BMP, PCX, PNG or TGA.
Additionally you can use the color command to display different colors / alpha as the background. Using the default color command gives you the blue background used in most of Anachronox.
Okay, that covers the way a window looks, let's look at a command to title
This takes the text after it and makes it bold, and prints it before the "body". Even if you put TITLE last, it will be at the top of the window. It's often used for a character's name in Anachronox. Use it like this:
title "Character Name"
There are lots of other commands that can affect the window's size and position on the screen. Anachronox will automatically size the window to your text, and center it. If you prefer to control where it is placed or how big it is, use these commands.
This allows you to specify at what X and Y coordinate on the screen to place the window. This coordinate, of course, is the upper left corner. By the way, the Anachronox screen is 640 x 480 pixels big
You would use them like this:
If no height is given, Anachronox will automatically scale the height to
fit the text in it. Note: Setting a height on dialog windows can cause
your text to clip.
The counter to this feature would be:
Specify a height beyond which the window can't extend. This is useful if you don't want the window to extend past a certain place on the screen, but you don't want to have to specify the height, or you want it to automatically size to fit the text nicely. One example is you want the window to size nicely, but not ever extend to cover the character's faces, which may be halfway down the screen.
It goes like this:
// This is a commented out line
title "Window Testing"
body "Here's a whole bunch of character text which if you want to you can go to the next
line to type because it is looking for a quotation mark to end the string. "
body "This line will be tacked on to the end of the previous one. To generate a "
body "carriage return between lines you can use backslash n, like this. \n"
body "Now we are on a new line."
Compile Lesson2 just like you did LESSON1, and see what it does in Anox! In case you haven't figured it out, this time you need to "invoke 2:1"
Okay, that's it for this lesson. In Lesson 3, we'll learn about choices, and how to put graphics in the windows!