Graphical Window Sprites
version 1 by Erik Temple
Documentation
- Section: Concepts: Sprites and "the Background"
- Section: Defining the Background
- Section: Defining Sprites
- Section: Drawing Rules
- Section: Hyperlinking Sprites
- Section: Simple Calculations with Coordinates
- Section: Debugging Commands
- Section: Preloading Sprites
- Section: Producing Images for Use with Graphical Window Sprites
- Section: Troubleshooting
- Section: Summary of Sprite Properties
- Section: A Note on Interpreters
- Section: Timer-Based Drawing
- Section: Credits
- Section: Change Log
- Example: ** Clickable Compass - A graphical compass rose on which the exits from the current room ar
- Example: *** Castle of Sprites - An onscreen map of a multilevel space that reveals itself as the pl
Graphical Window Sprites provides a framework for displaying "sprites," discrete programming objects that allow multiple images to be easily organized, individually scaled, and drawn in composite to a Glulx graphical window. When used in conjunction with Jeff Sheets' Graphic Links extension, sprites can also be hyperlinked to respond independently when the player clicks on them in the window. The extension should be useful for many applications, including the construction of gradually revealed or otherwise dynamic maps, visual puzzles, games such as poker or tic-tac-toe, visual scenes and narratives, and graphical user interfaces.
Graphical Window Sprites was designed to work with Inform build 5Z71. It requires both Emily Short's Simple Graphical Window and Glulx Entry Points, as well as Michael Callaghan's Fixed Point Maths extension. Fixed Point Maths is used to provide the ability to express image scale as a simple ratio with a precision of four decimal digits (in other words, a sprite can be scaled to 85% of its original size by specifying a ratio of 0.8500). Mouse input (hyperlinked sprites) requires version 2 or later of Jeff Sheets' Graphic Links extension.
Image files to be used with the examples below, as well as another example with source and images, can be found at http://www.sendspace.com/file/fowqkq.