0 votes
by (250 points)
edited by

So, I am experimenting with an idea where a variable changes in a passage, & once I reload the passage (via <<script>>Engine.show()<</script>>) new paragraphs appear based on those variables. I like the short ease-in transition between paragraphs appearing, but every time the passage reloads, all the words in the passage also fade back in because of Twine's transition effect of (grabbed from Sugarcube's source code):

.passage {
    line-height: 1.75;
    text-align: left;
    transition: opacity 400ms ease-in;
}

My question is, is there any way to keep that transtiion between paragraphs (wtihout doing, say, <<timed 1.0s t8n>>Paragraph here<</timed>> for each one) while eliminating the passage transition effect? Or would I need to write completely new code?

2 Answers

0 votes
by (2.4k points)
I'm having a similar issue (in my case I'm reloading the passage via a <<link>> redirecting to the same passage so the variables updates and the new paragraphs appear) and also having the problem of the transition showing up.

I've been trying to use javascript to remove that transition property of the .passage CSS before the passage is reloaded and adding it again afterwards, but to no avail.

I'll keep trying and if I manage to make it work I'll put it here. Also if you discover how to do it, I would preciate some help ;)
by (63.1k points)
Ideally, you want to use the DOM macros like <<replace>> to update what's on screen. Reloading the passage adds junk entries to the history.
by (2.4k points)
I've tried those, but the problem is that if the player saves and reload in the middle of a modified passage it goes back to its original state when reloading the game.
0 votes
by (63.1k points)
You can control the passage transition with the appropriate config property: http://www.motoslave.net/sugarcube/2/docs/#config-api-property-passages-transitionout
...