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:hover-style

(hover-style: Changer) → Changer

Given a style-altering Changer, it makes a changer which only applies when the hook or expression is hovered over with the mouse pointer, and is removed when hovering off.

Example usage:

The following makes a (link:) that turns cyan and italic when the mouse hovers over it.

(hover-style:(text-color:cyan) + (text-style:'italic'))+(link:"The lake")
[The still, cold lake.]

Rationale:

Making text react in small visual ways when the pointer hovers over it is an old hypertext tradition. It lends a degree of “life” to the text, making it seem aware of the player. This feeling of life is best used to signify interactivity - it seems to invite the player to answer in turn, by clicking. So, adding them to (link:) changers, instead of just bare words or paragraphs, is highly recommended.

Details:

True to its name, this macro can only be used for subtle style changes. Only the following changers (and combinations thereof) may be given to (hover-style:) - any others will produce an error:

More extensive mouse-based interactivity should use the (mouseover:) and (mouseout:) macros.

This macro is not recommended for use in games or stories intended for use on touch devices, as the concept of “hovering” over an element doesn't really make sense with that input method.

See also:

harlowe/hover-style.txt · Last modified: 2017/06/18 23:20 by l