Advanced graphics for Inform 7

Glimmr released

Glimmr, a set of extensions for use with Inform 7 and the subject of this occasional blog, has finally been released. For the uninitiated, Inform is software for writing interactive fiction, otherwise known as “text adventures,” using English-like sentences. Inform can compile to the Glulx virtual machine, which allows for graphics, sound, and other features. But Inform’s native support for these features is quite meager, and Glimmr is an attempt to bring Inform’s support for graphics up to the level of Glulx’s potential.

Glimmr is a modular system of extensions. Several of these extensions can be used independently of other Glimmr modules, but they gain additional capabilities when used in conjunction. The bedrock extension, Glimmr Drawing Commands, provides basic instructions to draw a wide variety of entities, from simple rectangles, to external images files (PNG or JPEG), to bitmaps and even painted text. Here are some representative drawing commands:

Representative drawing commands available using Glimmr

Other extensions are what we might call “data” extensions, which don’t themselves provide new functionality. Fonts and tilesets are distributed in this way. Examples include Glimmr Bitmap Font and Glimmr Image Font.

But the core of Glimmr is the Canvas-Based Drawing extension. This module supplies a complete screen model for graphics windows, using the notion of the “canvas”. Graphic elements–anything that can be drawn using Glimmr Drawing Commands, or any new command the user wishes to invent–are assigned to a canvas. The canvas can then be shown in a graphics window. The scaling and the framing of the canvas within the window can be controlled, and canvases can be swapped out at will. It is easy to specify the layering of elements on the canvas, so that in effect graphics can be displayed along three axes (x, y, and z). Canvas-Based Drawing allows for complex and dynamic compositions to be created relatively quickly. The Glimmr Graphic Hyperlinks extension automates the handling of mouse input to any element.

Glimmr ships with another extension, built on Canvas-Based Drawing, called the Glimmr Canvas Editor. The Canvas Editor is meant to be compiled as an independent project, not as a part of another game, and it produces a complete GUI graphics editor that can be used to draw elements of various types to a canvas, visually. Once the canvas is complete, you can export it as Inform source code for use with Canvas-Based Drawing. Special features are included to deal with canvases that change over time, such as maps that dynamically reveal themselves as the player discovers new locations in the game.

Download Glimmr.


Comments on: "Glimmr released" (6)

  1. […] here. Note that Glimmr Automap will initially be provided as a separate download from the main Glimmr package, but will be rolled into the main package at the next release. Glimmr Automap. Click for […]

  2. Wow. When it comes to roguelike example – are those tiles separate “rooms” or is it one room and various objects can be actually “placed” in it?
    so for example, if there’s a crate to be pushed – it can be pushed around in one roo, not only between rooms. or if I’m holding an item – I can drop it on any square, or throw it. or move barrels around, throw my blanked in the courner and take a nap there…
    so the question – again- is – do those tiles represent separate rooms, or can be a layout of a single room – with possible actions – perhaps – which I mentioned? Regards

    • The tiles are not separate rooms–in the example, each room is depicted as a tiled map, and the player and NPCs move over the map independently. You could add objects to the map as well, and in principle do any of the things you mentioned in your post–drop them on any map square, push crates around, etc. The example doesn’t implement any system for collision detection (and cheats a bit on movement for that reason), so you would need to develop a system for tracking such things. Sebastian Rahn, who authored two extensions for Inform that implement tiled maps (ASCII only) and even AI movement, has been working on an overhaul of those extensions; I don’t know where he is with that, but we have talked about ways to make it compatible with Glimmr. Maybe there’ll be a complete solution one day soon!

      • Thank you for your swift answer. That’d would rock. Seeing how roguelike games gained popularity – thanks to Dwarf Fortress (big share of it, perhaps) – and having a possilbity of mixing it with detailed descriptions of Interactive Fiction – and ease of programming thanks to Inform 7,
        the whole mix could prove extra popular. I’ll be looking forward to any updates on that matter. Definitely subscribing to your blog as well. Thank you

  3. […] this tutorial, we’ll be creating a hybrid compass rose and exit lister using Glimmr Canvas-Based Drawing. Here’s what our exit lister will do: It will show, on a compass rose, the directions […]

  4. […] a comment Buried in Glimmr Drawing Commands, the bedrock Glimmr extension responsible for drawing images directly to the screen, is a set of commands for drawing […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: