I was wondering if it is possible to add a function in Twine 2 where a player is taken to a new passage when they move their mouse cursor over a certain text. For example, if there is a bit of text that says: "Don't look at the black cat", and the player is taken to a new passage if they move the cursor over "black cat". I am using Sugarcube 2. Any help would be greatly appreciated!
Comments
Something like the following: (goes in Story JavaScript) Syntax: Usage:
@greyelf I wouldn't say better necessarily, your modification is on point. I do have some idioms that I like to follow, however, so I would have made some different choices.
Here's my update: Like greyelf's version, the wrapper contains the class mousegoto, which you may use for styling if you wish.