User Tools

Site Tools


Sidebar

Passage markup

basics

coding

extra

list

section

whitespace

Macros

basics

colour

data structure

date and time

game state

live

maths

number

revision

saving

showing and hiding

string

styling

url

deprecated

Types of data

Special keywords

Special passage tags

harlowe:changer

Changer data

Changer commands (changers) are similar to ordinary commands, but they only have an effect when they're attached to hooks, and modify the hook in a certain manner. Macros that work like this include (text-style:), (font:), (transition:), (text-rotate:), (hook:), (click:), (link:), and more.

You can save changer commands into variables, and re-use them many times in your story:

(set: $robotic to (font:'Courier New'))
$robotic[Hi, it's me. Your clanky, cold friend.]

Alternatively, you may prefer to use the (enchant:) macro to accomplish the same thing using only hook names:

|robotic>[Hi, it's me. Your clanky, cold friend.]
(enchant: ?robotic, (font:'Courier New'))

Changers can be combined using the + operator: (text-colour: red) + (font: "Courier New")[This text is red Courier New.] styles the text using both changers at once. These combined changers, too, can be saved in variables or used with (enchant:).

(set: _alertText to (font:"Courier New") + (text-style: "shudder") + (text-colour:"#e74"))
_alertText[Social alert: no one read the emails you sent yesterday.]
_alertText[Arithmetic error: I forgot my seven-times-tables.]
harlowe/changer.txt · Last modified: 2017/06/18 23:23 by l