Flexible Windows

version 13/130803 by Jon Ingold

  • Home page
  • Beginning
  • Previous
  • Next



  • Example: * Inventory Window - A simple example showing how to place an side window displaying the player's inventory.

        "Inventory Window"

        The Study is a room. In the study is an old oak desk. On the desk is a Parker pen, a letter, an envelope and twenty dollars.

        Include Flexible Windows by Jon Ingold.

        The side-window is a text-buffer g-window spawned by the main-window.

    The default setting for position - on the right - will do here, but the window could be smaller.

        The measurement of the side-window is 30.

        Window-drawing rule for the side-window (this is the construct inventory rule):
            move focus to side-window, clearing the window;
            try taking inventory;
            return to main screen.

    Finally, two rules: one to make the window appear, and the other to keep it up-to-date.

        When play begins:
        open up the side-window.

        Every turn when the side-window is g-present: follow the window-drawing rules for the side-window.

        Test me with "take pen/take letter/i/take all".