User Tools

Site Tools


harlowe:dropdown

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

harlowe:dropdown [2019/04/16 02:43] (current)
l created
Line 1: Line 1:
 +**(dropdown:​ //​[[harlowe:​bind|Bind]],​ ...[[harlowe:​string|String]]//​) → //​[[harlowe:​command|Command]]//​**
  
 +A [[harlowe:​command|command]] that, when evaluated, creates a dropdown menu with the given [[harlowe:​string|strings]] as options. When one option is selected, the bound variable is set to match the string value of the text.
 +
 +=== Example usage: ===
 +
 +  * ''​%%(dropdown:​ bind _origin, "​Abyssal outer reaches",​ "​Gyre'​s wake", "The planar interstice"​)%%''​
 +
 +=== Rationale: ===
 +
 +Dropdown menus offer a more esoteric, but visually and functionally unique way of presenting the player with a choice from several options. Compared to other list-selection elements like [[harlowe:​cycling-links|(cycling-links:​)]] or lists of links, dropdowns are best used for a long selection of options which should be displayed all together, but would not otherwise easily fit in the screen in full.
 +
 +While dropdowns, whose use in form UI suggests themes of bureaucracy and utility, may appear best used for "​character customisation"​ screens and other non-narrative purposes, that same imagery can also be a good reason to use them within prose itself - for instance, to present an in-story bureaucratic form or machine control panel.
 +
 +=== Details: ===
 +
 +Note that unlike [[harlowe:​cycling-link|(cycling-link:​)]],​ another command that uses bound variables, the bound variable is mandatory here.
 +
 +Also note that unlike [[harlowe:​cycling-link|(cycling-link:​)]],​ empty strings can be given. These instead create **separator elements**, which are rendered as unselectable horizontal lines that separate groups of options. Having empty strings as the first or last elements, however, will result in an error (as these can't meaningfully separate one group from another).
 +
 +The first element in a (dropdown:) will always be the one initially displayed and selected - and thus, the one that is immediately set into the bound variable.
 +
 +=== See also: ===
 +
 +[[harlowe:​cycling-link|(cycling-link:​)]]
harlowe/dropdown.txt · Last modified: 2019/04/16 02:43 by l