Glimmr Form Fields
version 1/101201 by Erik Temple
Documentation
- Chapter: About Glimmr Form Fields
- Chapter: Defining the input field
- Chapter: Defining the input stream
- Chapter: Alternate ways of initiating input in a field
- Chapter: A field's accepted input
- Chapter: Accessing the player's input
- Chapter: Numeric input fields
- Chapter: Customizations
- Chapter: A note on performance and compatibility
- Chapter: Contact info
- Example: * Minimalist Exercise - This example illustrates the basics of usage, with a single form field in which the player is invited to type a handful of characters. The text typed is echoed back in the main window. If the player types a number (positive or negative), the input will be interpreted as a number and that too will be echoed.
- Example: ** Color Picker - Inform 6/Glulx requires colors to be specified in hex format (e.g., FEFE01). However, Inform 7 does not accept hex values as numbers, so it is necessary to provide such values as a decimal; for example FEFE01 must be given as 16711169 at the I7 level. This is inconvenient, especially when we're beginning with an RGB triad, since we must first convert the RGB to hex, and then convert the hex value to a decimal. This example ameliorates this problem by creating a tool that converts instantly between RGB, hex, and decimal.
Chapter: About Glimmr Form Fields
Glimmr Form Fields (GFF) is a rather odd beast, and I don't really expect many people to find it useful. But it is kind of neat even so... The extension allows you to define any g-element (graphic element, see Glimmr Canvas-Based Drawing) as a "field" for input. A graphic representation of a string of text can be associated with this field. When clicked with the mouse or triggered by a command, the field will activate, a cursor will appear, and the player will be able to type to add text to the field. The player's typed input is stored in an indexed text property, and can also be converted into a number if the input is numeric.
Glimmr Form Fields requires most of the other Glimmr extensions in order to function, including Glimmr Canvas-Based Drawing, Glimmr Drawing Commands, and Glimmr Graphic Hyperlinks. Also required are Glimmr's dependencies, including Flexible Windows by Jon Ingold and Fixed Point Maths by Michael Callaghan, as well the Glulx Input Loops extension. GFF also requires at least one font extension, such as Glimmr Bitmap Font or Glimmr Image Font.