Some games, like Superhot, have a neat little feature where you can mash on the keyboard and no matter what you actually type in, a predefined message comes out. This macro provides a similar function to Twine.
Author | ChapelR |
Website | https://twinelab.net/custom-macros-for-sugarcube-2/#/type-sim |
Story format | SugarCube 2 |
Last checked | Tue Apr 20 2021 |
License | Unlicense |
Download | typing.zip |
📝 Note:
As of v2.9.0 of the collection (v2.0.0 of this macro) the <<typesim>>
macro is mobile friendly and should work on phones and other devices with software keyboards!
Some games, like Superhot, have a neat little feature where you can mash on the keyboard and no matter what you actually type in, a predefined message comes out. This macro provides a similar function to Twine.
The <textarea>
generated will just use SugarCube's standard styling. If you want to alter its appearance, it has the class .macro-typesim
.
When the typing simulation is finished, the event :type-sim-end
is triggered on the document's root. The event object has a message
property containing the message that was typed out.
$(document).on(':type-sim-end', function (ev) {
console.log('Typing simulation message: ', ev.message);
});
Demo Twee code:
:: Start <<typesim "Hey Jim, I won't be in to work today, sorry.">>Finished.<</typesim>>