{"id":1106,"date":"2019-10-24T14:50:01","date_gmt":"2019-10-24T14:50:01","guid":{"rendered":"http:\/\/seriousplaylab.com\/courses\/edu5863\/?page_id=1106"},"modified":"2021-03-03T20:09:12","modified_gmt":"2021-03-03T20:09:12","slug":"twine-2-0-quick-start","status":"publish","type":"page","link":"https:\/\/seriousplaylab.com\/courses\/edu5863\/?page_id=1106","title":{"rendered":"Twine 2.0 Quick Start"},"content":{"rendered":"\n<h3 id=\"adding_an_image\">How to Create Passages &amp; Links<\/h3>\n\n\n\n<p>Most of the time, you&#8217;ll be linking from one passage to another. <strong>The easiest way to do this is to put the name of the passage you&#8217;re linking to in between two square brackets, [[like this]].<\/strong> This will turn the passage name into a clickable link. This is just like our Wikimedia system\u2026<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img alt=\"\"\/><\/figure>\n\n\n\n<p>[[Open]] the time door\u2026<\/p>\n\n\n\n<p>[[Open the time door]]\u2026<\/p>\n\n\n\n<p>Open the [[time door]]\u2026<\/p>\n\n\n\n<p>Everything in brackets will be highlighted link [and the title of your next passage]<\/p>\n\n\n\n<p>However, you may also want to have the text shown on the page be different from the passage name. For example, you might have two ways to reach a passage, or you may not want to give away the name of the destination. In these cases, you can write this:<\/p>\n\n\n\n<ul><li>[[Open the time door | into the fire]] Open the time door will be the text URL (but the player will be taken to the fire passage&#8230;<\/li><\/ul>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h3 id=\"adding_an_image\">Adding an Image<\/h3>\n\n\n\n<p>Once you know what your image&#8217;s <abbr title=\"Uniform Resource Locator\">URL<\/abbr> is, having it display in your story is as simple as entering the correct <abbr title=\"HyperText Markup Language\">HTML<\/abbr> code to show up: <strong>You can upload images and audio files to your websites (or host them on google drive or dropb ox).<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;<a href=\"http:\/\/december.com\/html\/4\/element\/img.html\">img<\/a> src=\"the URL of your image\" width=\"500\" height=\"300\" alt=\"Two foxes\"&gt;  <br><br>&lt;<a href=\"http:\/\/december.com\/html\/4\/element\/img.html\">img<\/a> src=\"the URL of your image\"alt=\"Two foxes\"&gt;<\/pre>\n\n\n\n<p><strong>The width and height part of the code control the size of your image on the page.<\/strong> If you leave them off, then it will display the image in the dimensions as you saved it. This is good reducing size. <strong>However, if you increase size or alter the dimensions, the image may look distorted or pixelated. Do the MATH (ratios) to ensure that consistent dimensions if you enlarge or reduce image size.<\/strong><\/p>\n\n\n\n<h3>Adding a Background Image for Entire Twine (Style Sheet Editor)<\/h3>\n\n\n\n<p>To add background image or animated .gif, make sure you select image of high quality\/large size. Go to CSS editor:<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p><strong>tw-story { background-image:url(ENTER YOUR URL HERE); background-size:cover; }<\/strong><\/p>\n\n\n\n<p>example:<\/p>\n\n\n\n<p><strong>tw-story { background-image:url(http:\/\/www.seriousplaylab.com\/twine20\/portal.jpg); background-size:cover; }<\/strong><\/p>\n\n\n\n<p>if example above does not work, try adding the &#8220;quotes&#8221; from around the URL (like this below). <\/p>\n\n\n\n<p><strong>tw-story { background-image:url(&#8220;http:\/\/www.seriousplaylab.com\/twine20\/portal.jpg&#8221;); background-size:cover; }<\/strong><\/p>\n\n\n\n<h3>Adding a Different Background Image for Different Passages<\/h3>\n\n\n\n<p>tw-story { background-image:url(&#8220;ENTER YOUR URL HERE&#8221;); background-size:cover; } Code with tag: &#8211; The tag here is the word &#8220;snow&#8221; tw-story[tags~=&#8221;snow&#8221;] { background-image:url(&#8220;ENTER YOUR URL HERE&#8221;); background-size:cover; }<\/p>\n\n\n\n<p>Example below: In the Style Sheet Editor I added this code. The tag (e.g., home or portal) is created on the passage page (very top there is create &#8220;tag&#8221; option). <strong>NOTE (make sure the &#8220;quotes&#8221; below are reformatted currently if you cut and paste this to the Twine). <\/strong><\/p>\n\n\n\n<p><strong>tw-story[tags~=&#8221;home&#8221;] { background-image:url(http:\/\/www.seriousplaylab.com\/twine20\/portal.jpg); background-size:cover; }<\/strong><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>tw-story[tags~=&#8221;portal&#8221;] { background-image:url(http:\/\/www.seriousplaylab.com\/twine20\/tt.gif); background-size:cover; }<\/strong><\/p>\n\n\n\n<h3 id=\"adding_a_video\">Adding a Video<\/h3>\n\n\n\n<p>If you&#8217;d like to embed a video from a service like YouTube or Vimeo, check the page for an option to embed it. See <a href=\"https:\/\/support.google.com\/youtube\/answer\/171780\">YouTube&#8217;s help<\/a> and <a href=\"https:\/\/vimeo.com\/help\/faq\/sharing-videos\/embedding-videos\">Vimeo&#8217;s help<\/a> for specific instructions on how to get the embed code and customize it. Once you have that code, enter it as-is into your passage to have it display.<strong>&nbsp;YouTube or Vimeo, check the page for a &#8220;share&#8221; option to embed it. E.g., on Youtube: you hit \u201cshare\u201d and select \u201cembed\u201d (cut &amp; paste the hmtl code into your passage]\u2026<\/strong><\/p>\n\n\n\n<p>The code to enter for a video (that you are hosting) is similar to what you use for an image:<\/p>\n\n\n\n<p>&lt;video src=&#8221;the URL of your video&#8221; width=&#8221;640&#8243; height=&#8221;480&#8243;&gt; &lt;\/video&gt;<\/p>\n\n\n\n<p>There are a lot more options for customizing how your video appears \u2013 try this <a href=\"http:\/\/www.html5rocks.com\/en\/tutorials\/video\/basics\/\">HTMl5Rocks article<\/a> for details.<\/p>\n\n\n\n<h3>Adding Sound Effects and Music<\/h3>\n\n\n\n<p>The code to add a basic sound effect (Harlow, default) looks like this. This would go in the passage where you want the sound to start&#8230;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;audio src=\"http:\/\/www.seriousplaylab.com\/twine20\/twinesound.mp3\" autoplay&gt;<\/pre>\n\n\n\n<p>The autoplay attribute causes it to play as soon as the passage it is in is displayed.<\/p>\n\n\n\n<p><strong>However before you can make this work<\/strong>, you need to do some Java work: <strong>Go to the Edit Java Script editor.<\/strong> Add the following code, but substitute my audio URL for the audio URL you would like to use.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>var audio = document.createElement('audio');<\/strong>\n<strong>audio.scr = <\/strong>\n<strong>'http:\/\/www.seriousplaylab.com\/twine20\/twinesound.mp3';<\/strong>\n<strong>audio.loop = true;<\/strong>\n<strong>audio.play();<\/strong><\/pre>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>\n\nFor multiple audio pieces with your Twine, see following example: \n<\/strong><\/pre>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>{\nvar audio = document.createElement('audio');\naudio.scr = \n&nbsp;&nbsp; &nbsp;'http:\/\/www.seriousplaylab.com\/twine20\/twinesound.mp3';\naudio.loop = true;\naudio.play();\n}\n\n{\nvar audio = document.createElement('audio');\naudio.scr = \n&nbsp;&nbsp; &nbsp;'http:\/\/www.seriousplaylab.com\/twine20\/eurorack2.wav';\naudio.loop = true;\naudio.play();\n}\n<\/strong><\/pre>\n\n\n\n<p><strong>Create\/Edit your Soundtrack or Sound Effects of Passage Voice-Work<\/strong><\/p>\n\n\n\n<p>I saved this file as an MP3 and uploaded to my site (or googledrive etc). <strong>Garage Band. <\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"http:\/\/seriousplaylab.com\/courses\/3610b\/wp-content\/uploads\/2019\/10\/Screen-Shot-2019-10-23-at-4.12.00-PM.png\"><img src=\"http:\/\/seriousplaylab.com\/courses\/3610b\/wp-content\/uploads\/2019\/10\/Screen-Shot-2019-10-23-at-4.12.00-PM-1024x640.png\" alt=\"\" class=\"wp-image-1644\"\/><\/a><\/figure>\n\n\n\n<p>I saved this file as an MP3 and uploaded to my site (or googledrive etc). <strong>Audacity<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"http:\/\/seriousplaylab.com\/courses\/3610b\/wp-content\/uploads\/2019\/10\/Screen-Shot-2019-10-23-at-4.13.56-PM.png\"><img src=\"http:\/\/seriousplaylab.com\/courses\/3610b\/wp-content\/uploads\/2019\/10\/Screen-Shot-2019-10-23-at-4.13.56-PM-1024x594.png\" alt=\"\" class=\"wp-image-1645\"\/><\/a><\/figure>\n\n\n\n<h2 id=\"how_to_format_text\">How to Format Text<\/h2>\n\n\n\n<p>You&#8217;ll notice that there aren&#8217;t buttons to add bold or italic styles to your text in Twine, like in a word processor. Instead, Twine story formats use special characters to convey style information. The special characters you type are changed into styles when you play or test your story.<\/p>\n\n\n\n<p>The fastest way to see how what you enter will be interpreted as a style is by using the <strong>Test From Here<\/strong> item in the <a href=\"https:\/\/twinery.org\/wiki\/twine2:the_story_map#adding_moving_and_deleting_passages\">passage menu<\/a>.<\/p>\n\n\n\n<p><strong>The exact characters to enter depend on which story format you&#8217;re using. <\/strong> <strong>Harlowe<\/strong> (the default one) and <strong>Snowman<\/strong> both use <a href=\"http:\/\/daringfireball.net\/projects\/markdown\/\">Markdown<\/a>, a commonly-used set of formatting instructions. <strong>SugarCube<\/strong> instead uses a convention similar to what&#8217;s used on Wikipedia <sup><a href=\"https:\/\/twinery.org\/wiki\/twine2:how_to_format_text#fn__1\">1)<\/a><\/sup>.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Harlowe<\/th><th>Snowman<\/th><th>SugarCube<\/th><\/tr><\/thead><tbody><tr><td><strong>Bold<\/strong><\/td><td><code>**Bold**<\/code> or <code>''Bold''<\/code><\/td><td><code>**Bold**<\/code><\/td><td><code>''Bold''<\/code><\/td><\/tr><tr><td><em>Italics<\/em><\/td><td><code>*Italics*<\/code> or <code>\/\/Italics\/\/<\/code><\/td><td><code>*Italics*<\/code><\/td><td><code>\/\/Italics\/\/<\/code><\/td><\/tr><tr><td><em>Underlined<\/em><\/td><td><code>&lt;u&gt;Underlined&lt;\/u&gt;<\/code><\/td><td><code>&lt;u&gt;Underlined&lt;\/u&gt;<\/code><\/td><td><code>__Underlined__<\/code><\/td><\/tr><tr><td>For more information<\/td><td><a href=\"https:\/\/twine2.neocities.org\/1.html#markup_link\">Visit here<\/a><\/td><td><a href=\"http:\/\/daringfireball.net\/projects\/markdown\/\">Visit here<\/a><\/td><td><a href=\"http:\/\/www.motoslave.net\/sugarcube\/docs\/markup.html#basic-formatting\">Visit here<\/a><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>You can combine styles in any story format by combining them, so that <code>***bold and italic***<\/code> will be displayed as <strong><em>bold and italic<\/em><\/strong> in Harlowe.<\/p>\n\n\n\n<h2>Change the Font, Colors, or Appearance<\/h2>\n\n\n\n<p>If you&#8217;re looking for simple formatting changes such as bolding or italicizing text, then the <a href=\"https:\/\/twinery.org\/wiki\/twine2:how_to_format_text\">How to Format Text<\/a> page will help you out.<\/p>\n\n\n\n<p>But what if you&#8217;d like to change the font or color scheme of your published story? The best way to accomplish that is to <a href=\"https:\/\/twinery.org\/wiki\/twine2:adding_custom_javascript_and_css\">edit your story&#8217;s stylesheet<\/a>. This uses CSS, a standard web technology.<\/p>\n\n\n\n<p>If you&#8217;ve never written CSS before, there are many tutorials out there that can help you learn it. The <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/Guide\/CSS\/Getting_started\">Mozilla Developer Network<\/a> in particular has a very comprehensive tutorial.<\/p>\n\n\n\n<p>Basic changes are not terribly complicated. Let&#8217;s talk about some two common scenarios.<\/p>\n\n\n\n<h3>Changing the Font<\/h3>\n\n\n\n<p>CSS Editor<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"http:\/\/seriousplaylab.com\/courses\/3610b\/wp-content\/uploads\/2019\/10\/font.png\"><img src=\"http:\/\/seriousplaylab.com\/courses\/3610b\/wp-content\/uploads\/2019\/10\/font.png\" alt=\"\" class=\"wp-image-1648\"\/><\/a><\/figure>\n\n\n\n<p><a href=\"https:\/\/twinery.org\/wiki\/twine2:change_the_font_colors_or_appearance\">You can very easily change the font your entire story uses with a declaration like this in your story stylesheet:<\/a><\/p>\n\n\n\n<p>Changing the Color Scheme<\/p>\n\n\n\n<p>Colors are recorded in CSS in variety of ways, but the most succinct and commonly-used is called a hex triplet. The first two digits represent how much red the color contains, the second duo how much green, and the final how much blue. So, pure red is written as #ff0000. <sup><a href=\"https:\/\/twinery.org\/wiki\/twine2:change_the_font_colors_or_appearance#fn__1\">1)<\/a><\/sup> You can play with colors with online tools like <a href=\"https:\/\/color.adobe.com\">Adobe Color<\/a> or <a href=\"http:\/\/paletton.com\/\">Paletton<\/a>, and then using the hex triplets in your own code.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"http:\/\/seriousplaylab.com\/courses\/3610b\/wp-content\/uploads\/2019\/10\/css.png\"><img src=\"http:\/\/seriousplaylab.com\/courses\/3610b\/wp-content\/uploads\/2019\/10\/css.png\" alt=\"\" class=\"wp-image-1647\"\/><\/a><\/figure>\n\n\n\n<h2>Add HTML<\/h2>\n\n\n\n<p>If you&#8217;d like to add HTML to your story \u2013 for example, some text you have customized, or you have some code to embed a resource like a YouTube video \u2013 you can add it directly to your passage&#8217;s text. It will displayed exactly as you&#8217;ve entered it.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/seriousplaylab.com\/courses\/edu5863\/wp-content\/uploads\/2021\/03\/cats.jpg\"><img loading=\"lazy\" width=\"1024\" height=\"1024\" src=\"https:\/\/seriousplaylab.com\/courses\/edu5863\/wp-content\/uploads\/2021\/03\/cats-1024x1024.jpg\" alt=\"\" class=\"wp-image-1298\" srcset=\"https:\/\/seriousplaylab.com\/courses\/edu5863\/wp-content\/uploads\/2021\/03\/cats-1024x1024.jpg 1024w, https:\/\/seriousplaylab.com\/courses\/edu5863\/wp-content\/uploads\/2021\/03\/cats-300x300.jpg 300w, https:\/\/seriousplaylab.com\/courses\/edu5863\/wp-content\/uploads\/2021\/03\/cats-150x150.jpg 150w, https:\/\/seriousplaylab.com\/courses\/edu5863\/wp-content\/uploads\/2021\/03\/cats-768x768.jpg 768w, https:\/\/seriousplaylab.com\/courses\/edu5863\/wp-content\/uploads\/2021\/03\/cats-50x50.jpg 50w, https:\/\/seriousplaylab.com\/courses\/edu5863\/wp-content\/uploads\/2021\/03\/cats.jpg 1200w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>How to Create Passages &amp; Links Most of the time, you&#8217;ll be linking from one passage to another. The easiest way to do this is to put the name of the passage you&#8217;re linking to in between two square brackets, [[like this]]. This will turn the passage name into a clickable link. This is just&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":68,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/seriousplaylab.com\/courses\/edu5863\/index.php?rest_route=\/wp\/v2\/pages\/1106"}],"collection":[{"href":"https:\/\/seriousplaylab.com\/courses\/edu5863\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/seriousplaylab.com\/courses\/edu5863\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/seriousplaylab.com\/courses\/edu5863\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/seriousplaylab.com\/courses\/edu5863\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1106"}],"version-history":[{"count":6,"href":"https:\/\/seriousplaylab.com\/courses\/edu5863\/index.php?rest_route=\/wp\/v2\/pages\/1106\/revisions"}],"predecessor-version":[{"id":1299,"href":"https:\/\/seriousplaylab.com\/courses\/edu5863\/index.php?rest_route=\/wp\/v2\/pages\/1106\/revisions\/1299"}],"up":[{"embeddable":true,"href":"https:\/\/seriousplaylab.com\/courses\/edu5863\/index.php?rest_route=\/wp\/v2\/pages\/68"}],"wp:attachment":[{"href":"https:\/\/seriousplaylab.com\/courses\/edu5863\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1106"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}