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:alert

(alert: String) → Command

This macro produces a Command that, when evaluated, shows a browser pop-up dialog box with the given string displayed, and an “OK” button to dismiss it.

Example usage:

(alert:"Beyond this point, things get serious. Grab a snack and buckle up.")

Details:

This is essentially identical to the Javascript alert() function in purpose and ability. You can use it to display a special message above the game itself. But, be aware that as the box uses the player's operating system and browser's styling, it may clash visually with the design of your story.

When the dialog is on-screen, the entire game is essentially “paused” - no further computations are performed until it is dismissed.

See also:

harlowe/alert.txt · Last modified: 2017/10/10 00:39 (external edit)