User Tools

Site Tools


image

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
image [2014/01/26 07:03]
l [Importing images]
image [2017/10/10 00:39] (current)
Line 1: Line 1:
 +<- [[Editing Passages]] --------- [[Finishing Up And Proofing Your Work]]->
 +
 ======Images====== ======Images======
  
-It is said that the most important tag in early World Wide Web history was <img> - with it, web pages could finally stop looking like text documents and start looking like anything they wanted to look like. This is said to have been the Web's defining advantage over its competitors. In that sense, images and hypertext are intimately intwined, and in Twine their revelance is not diminished.+It is said that the most important tag in early World Wide Web history was <img> - with it, web pages could finally stop looking like structured ​documents and start looking like anything they wanted to look like. This was the Web's defining advantage over its competitors. In that sense, images and hypertext are intimately intwined, and in Twine their revelance is not diminished.
  
 =====Importing images===== =====Importing images=====
  
-Images can serve many purposes in a story or game - [[passage]] illustrations,​ [[stylesheet|background textures]], interstitial GIF animations, a drawn logo, and so forth. Given their vital importance, Twine enables you to incorporate **image assets** into your project'​s story file, as separate "​passages"​ alongside your text. Images stored in the story file will be embedded inside a finished story'​s built HTML - guaranteeing that the images will //always// be visible in the story, even if the HTML file is uploaded to a site or service like [[http://​philome.la/​|Philomela]].+Images can serve many purposes in a story or game - [[passage]] illustrations, ​page [[stylesheet|backgrounds]], interstitial GIF animations, a title logo, and so forth. Given their vital importance, Twine enables you to incorporate **image assets** into your project'​s story file, as separate "​passages"​ alongside your text. Images stored in the story file will be embedded inside a finished story'​s built HTML - guaranteeing that the images will //always// be visible in the story, even if the HTML file is uploaded to a site or service like [[http://​philome.la/​|Philomela]].
  
 You can add an image asset to your story by either using the "​Import Image" menu items in the Story menu, or by dragging and dropping an image file into the [[Story Map]]: You can add an image asset to your story by either using the "​Import Image" menu items in the Story menu, or by dragging and dropping an image file into the [[Story Map]]:
Line 11: Line 13:
 {{ :​drag-n-drop.png |}} {{ :​drag-n-drop.png |}}
  
-In Twine 1.4.2 or above, the program will ask you, when you build your story, if it can automatically import ​all of the external images used in the story - the images referred to by URLs.+In Twine 1.4.2 or above, the program will ask you, when you close a passage, if it can automatically import the external images used in it - the images referred to by URLs.
  
 Image assets appear in your story as passages with teal titles: Image assets appear in your story as passages with teal titles:
Line 22: Line 24:
  
 Since Twine games run in a web browser, any format that the browser supports can be displayed. However, the Twine development program only supports the following formats as imported image assets: PNG, GIF, JPEG, WebP and SVG. Furthermore,​ due to limitations in wxPython, WebP and SVG images will //not// display in the Story Map (but will remain usable in the browser). Since Twine games run in a web browser, any format that the browser supports can be displayed. However, the Twine development program only supports the following formats as imported image assets: PNG, GIF, JPEG, WebP and SVG. Furthermore,​ due to limitations in wxPython, WebP and SVG images will //not// display in the Story Map (but will remain usable in the browser).
-=====Syntax usage=====+=====Usage=====
  
 Once you've imported an image, you can refer to it by its name using this syntax: Once you've imported an image, you can refer to it by its name using this syntax:
  
->​[img[image name]]+>[img[//image name//]]
  
 You can make an image that is also a [[link]] to another passage: You can make an image that is also a [[link]] to another passage:
  
->​[img[image name][Passage name]]+>[img[//image name//][//Passage name//]]
  
 If you put the '<'​ or '>'​ symbols in front of '​img',​ it will be floated to the left or right, insetting it in the passage text: If you put the '<'​ or '>'​ symbols in front of '​img',​ it will be floated to the left or right, insetting it in the passage text:
  
->​[<​img[image name]] +>​[<​img[//image name//]] 
->​[>​img[image name]]+>​[>​img[//image name//]]
  
 You can add "alt text" (title text) to the image like so: You can add "alt text" (title text) to the image like so:
  
->​[img[alt text|image name]]+>[img[//alt text//|//image name//]]
  
 And, you can refer to external image URLs with this syntax, too. And, you can refer to external image URLs with this syntax, too.
  
->​[img[%%http://​l.j-factor.com/​gmhtml5/​Return_Alive/​icon.png%%]]+>[img[//%%http://example.com/​icon.png%%//]]
  
 This syntax is mostly a shorthand for the HTML <img> tag. If you need to customise the image further (for instance, by adding a class or style attribute) then you can fall back to <img> - but note that you can't refer to imported image assets with it: This syntax is mostly a shorthand for the HTML <img> tag. If you need to customise the image further (for instance, by adding a class or style attribute) then you can fall back to <img> - but note that you can't refer to imported image assets with it:
  
 ><img src="​image URL">​ ><img src="​image URL">​
 +
 +=====Usage in stylesheets=====
 +
 +The preceding section describes how to use images in passages. But, you can also use them in [[stylesheet]]s:​
 +
 +>//​selector//​ { //​property//:​ [img[//​image name//]] }
 +
 +When used in this context, the syntax is converted at runtime into:
 +
 +>//​selector//​ { //​property//:​ url(//image data...//) }
 +
 +So, anywhere that a url() attribute can be used, the [img] syntax can be deployed.
 +
 +
 +=====Story Formats=====
 +
 +You can get big style firepower out of using different [[story format|Story Formats]]. [[story format|Details about Story Formats appear earlier in this reference sequence.]]
 +
 +<- [[Editing Passages]] --------- [[Finishing Up And Proofing Your Work]]->
  
image.1390719798.txt.gz · Last modified: 2017/10/10 00:37 (external edit)