Changing transitions depending on context?

0 votes
asked Mar 13 by zerio920 (720 points)

So I know I can use this to change the incoming and outgoing transitions for all passages:

.passage-in {
}
.passage {
}
.passage-out {
}

And I know I can use this to change the incoming/outgoing transitions for passages with certain tags:

.passage[data-tags~="tag"] {
}
.passage-out[data-tags~="tag"] {
}

But can I give a passage a different transition depending on how the player takes to get there? So like if a player clicks a link that leads to a new passage, I could use a horizontal scroll, but if the player clicks a link that refreshes the current passage (by linking to itself), I could just do a simple fade in/out.

1 Answer

0 votes
answered Jun 24 by 4554551n (180 points)

Forgive me I am a noob, but maybe this is what you want to do? 

<<if previous() eq passage() >>
/% Fade In Transition %/
<<else>>
/% Horizontal scroll transition %/
<</if>>

Put your transition code and let us see if it works.

Welcome to Twine Q&A, where you can ask questions and receive answers from other members of the community.

You can also find hints and information on Twine on the official wiki and the old forums archive.

See a spam question? Flag it instead of downvoting. A question flagged enough times will automatically be hidden while moderators review it.
...