======Example files====== //This page is written by Leon Arnott and is separate from the Twine documentation.// To demonstrate a number of new features and coding techniques introduced in Twine 1.4, I've made a number of example .tws files. ====Visited()==== http://l.j-factor.com/twine/examples/Visited.tws This file demonstrates how, by using the [[function|visited() function]] inside the [[if|<> macro]], the player's state can be tracked without using any [[variable]]s. A "no-variable" Twine game can, for simple games, be easier and more fluent to write, due to not requiring the use of [[<>]]. ====Passage Macros==== http://l.j-factor.com/twine/examples/PassageMacros.tws This file shows how, by using the [[<>]] macro's shorthand, the [[function|parameter() function]], and, optionally, the [[tag|nobr tag]], you can write passages and invoke them as if they themselves were macros. The example code shows a basic use-case: creating a macro that varies the player's pronouns depending on their initial choice. ====Images==== http://l.j-factor.com/twine/examples/Transitions.tws This file simply serves as an example of imported [[image]]s, and the way in which they can be used both in [[passage]]s and in [[stylesheet]]s. ====Tagged Stylesheets==== http://l.j-factor.com/twine/examples/TagCSS.tws This file contains a number of [[stylesheet]]s that have [[tag]]s. These tags cause the stylesheets to only apply their CSS to passages with the same tag. You can use this to give specific passages a unique style. This example also shows how multiple tags can be used to combine multiple styles in the same passage. ====Transitions==== http://l.j-factor.com/twine/examples/Transitions.tws This file demonstrates a number of CSS transitions that can be added to your [[Sugarcane]] story. These are [[stylesheet]]s that use the [[tag|"transition" tag]] to signify that they should override Twine's default fade-in transition. This example also uses tags to allow each stylesheet to be viewed individually by the player. ====<>==== http://l.j-factor.com/twine/examples/Remember.tws This file provides a basic example of the [[<>]] and <> macros in use. ====StoryMenu==== http://l.j-factor.com/twine/examples/StoryMenu.tws This file serves as an example of using macros inside the StoryMenu, demonstrating that it automatically updates whenever the player changes passages.