User Tools

Site Tools



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

Link to this comparison view

harlowe:click [2017/10/09 20:39] (current)
Line 1: Line 1:
 +**(click: // [[harlowe:​HookName|hookname]] or [[harlowe:​String|String]]//​) -> //​[[harlowe:​Changer|changer]]//​**
 +Produces a [[harlowe:​command|command]] which, when attached to a hook, hides it and enchants the specified target, such that
 +it visually resembles a link, and that clicking it causes the attached hook to be revealed.
 +=== Example usage: ===
 +  * ''​%%There is a small dish of water. (click: "​dish"​)[Your finger gets wet.]%%''​ causes "​dish"​ to become a link that,
 +when clicked, reveals "Your finger gets wet." at the specified location.
 +  * ''​%%[Fie and fuggaboo!]<​shout| (click: ?​shout)[Blast and damnation!]%%''​ does something similar to every hook named ''​%%<​shout|%%''​.
 +=== Rationale: ===
 +The [[harlowe:​link|(link:​)]] macro and its variations lets you make passages more interactive,​ by adding links that display text when
 +clicked. However, it can often greatly improve your passage code's readability to write a macro call that's separate
 +from the text that it affects. You could want to write an entire paragraph, then write code that makes certain words
 +into links, without interrupting the flow of the prose in the editor.
 +The (click:) macro lets you separate text and code in this way. Place (click:) hooks at the end of your passages, and have
 +them affect named hooks, or text [[harlowe:​string|string]],​ earlier in the passage.
 +=== Details: ===
 +Text or hooks targeted by a (click:) macro will be styled in a way that makes them indistinguishable from passage links,
 +and links created by [[harlowe:​link|(link:​)]]. When any one of the targets is clicked, this styling will be removed and the hook attached to the
 +(click:) will be displayed.
 +Additionally,​ if a (click:) macro is removed from the passage, then its targets will lose the link styling and no longer be
 +affected by the macro.
 +=== Targeting ?Page or ?Passage: ===
 +When a (click:) command is targeting the ?Page or ?Passage, instead of transforming the entire passage text into
 +a link, something else will occur: a blue link-coloured border will surround the page, and
 +the mouse cursor (on desktop browsers) will resemble a hand no matter what it's hovering over.
 +Clicking a link when a (click:) is targeting the ?Page or ?Passage will cause both the link and the (click:) to
 +activate at once.
 +Using multiple (click:) commands to target the ?Page or ?Passage will require multiple clicks from the
 +player to activate all of them. They activate in the order they appear on the page - top to bottom.
 +=== See also: ===
 +[[harlowe:​link|(link:​)]],​ [[harlowe:​link-reveal|(link-reveal:​)]],​ [[harlowe:​link-repeat|(link-repeat:​)]],​ [[harlowe:​mouseover|(mouseover:​)]],​ [[harlowe:​mouseout|(mouseout:​)]],​ [[harlowe:​replace|(replace:​)]],​ [[harlowe:​click-replace|(click-replace:​)]]
harlowe/click.txt ยท Last modified: 2017/10/09 20:39 (external edit)