Glimmr Automap

version 2/101030 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next

  • Chapter: Basic usage

    Glimmr Automap renders the map data generated by Automap using a set of images defined by a "tileset." Tilesets are packaged as extensions, and Glimmr Automap Tileset is provided as part of Glimmr. Note that GLAM will not run properly without a tileset!

    At its most basic, adding Glimmr Automap to your story involves just two steps:

        1. Include the extension and a tileset extension.
        2. Create a "map-display window" and an accompanying canvas.

    The first step is simple. Unless we are using an alternate tileset, all we need to do is include these two sentences at the top of our story file:

        Include Glimmr Automap by Erik Temple.
        Include Glimmr Automap Tileset by Erik Temple.

    We must copy the image files for the Glimmr Automap user interface into the Materials->Figures folder of our Inform project, as well as the images for our tileset. See Chapter 22 of Writing with Inform for more information on using images.

    We may easily incorporate the "querying" functionality--which allows the player to click on a room in the map to reveal the room name in a tooltip--by including Glimmr Bitmap Font:

        Include Glimmr Bitmap Font by Erik Temple.

    Glimmr Automap defines a new kind of graphics g-window, the "map-display window". The automap will only appear in a map-display window. You will need to create your own map-display window and define its basic characteristics (see the Flexible Windows extension for more on windows). This code will open a window with a black background above the main text window:

        The map-window is a map-display window spawned by the main-window. The position is g-placeabove.

    We also need to associate a canvas with our window (see the docs for Glimmr Canvas-Based Drawing for more on canvases):

        The map-canvas is a g-canvas. The associated canvas of the map-window is the map-canvas.

    If we have no other graphics windows or graphic elements, this will be enough. If we do have our own g-elements, however, we will need to specify which ones belong on our automap canvas:

        The associated canvas of the map-renderer is the map-canvas. The associated canvas of a UI-element is the map-canvas.

    This is all that is required to get a fully functioning graphical automap into our game, including a set of zoom buttons. The following sections will dive into options for customizing and configuring GLAM.