Hello everyone,
I am wondering whether it is possible to add a function in my Twine 2 game where individual sentences become visible when the player hovers their mouse cursor over them. The thing I think might be tricky is that I want the text to disappear when the player moves their cursor off the text. My idea is that the player uses their mouse cursor kind of like a flashlight, causing white text to appear against a black background. Also, I want this feature to only last for a couple of passages, not the entire game.
I am using sugarcube 2.0 and hope that there might be some way to make this work, but I need a bit of help as I am not that skilled in working with it.
Many thanks to anyone who might answer this question.
Comments
You should be able to use the :hover pseudo class to toggle the foreground color between transparent and its normal color to achieve the effect you want. For example, add the following to your styles: (goes in Story Stylesheet)
Using it:
SugarCube v2 contains compatibility shims/layers for most things, to make the transition from v1 easier. It also contains all of the same basic markup and macros, in addition to newer features.
The only thing that changed without any kind of compatibility shim/layer is v1's Options system—which, honestly, was shite. It was replaced by v2's Setting API.
For a basic overview, go to the Upgrade Instructions for 2.x page of SugarCube v2's website and take a look at the Upgrading to any release ≥2.0.0 section. There's a lot of stuff in there, but you don't have to worry about things you're not using.
Looking at SugarCube v2's documentation may also prove useful.