Skip to content

Instantly share code, notes, and snippets.

@gabrielcornish
gabrielcornish / reveal.tw
Created May 16, 2022 15:13 — forked from JoshuaGrams/reveal.tw
Line-by-line text reveal: Twine/SugarCube.
:: Some Passage
This will show at the start.
@@.hide;This will show after you click or press space/enter.@@
@@.hide;.nocontinue;This will show after you advance again, but will <em>not</em> have the continue marker.@@
<span class="hide">HTML tags work fine too, but the other notation is shorter.</span>
.macro-ctp-entry-t8n {
opacity: 1;
animation: macro-ctp-fade-in 0.25s ease;
}
@keyframes macro-ctp-fade-in {
0% {
opacity: 0;
}
}
@gabrielcornish
gabrielcornish / dialogue.js
Created January 27, 2020 18:05
Functional Dialogue in Twine
State.variables.dialogue = []
$(document).on("mousedown", function (event) {
if (event.which == 1){
NextLine(State.variables.dialogue);
$.wiki('<<scrolldown>>');
}
});
window.RunDialogue = function(p){
@gabrielcornish
gabrielcornish / VN-style-dialogue-system(SugarCube-v2)-part1.md
Created December 12, 2019 20:27 — forked from cyrusfirheir/VN-style-dialogue-system(SugarCube-v2)-part1.md
Storing dialogue in plain text and converting it to html elements on the fly using JavaScript.

Storing dialogue in plain text and converting it to html elements on the fly using JavaScript. (Part 1)

Note!
This system is not a replacement for standard usage, and has been developed only to facilitate faster/easier markup of story/dialogue data. In no way is this advanced enough to handle choices and a bajillion conditionals. At least not yet.

This sort of an approach is best suited when one needs to display text sequentially (like in a Visual Novel) without focusing much on writing html or macros. I decided to do something like this because typing:

<<speech "Speaker Name">>
	Speech text