+2 votes
by (2.2k points)
edited by
This is gonna sound really stupid but I don't know how to get an image into the thing (I'll think of the actual word I'm looking for later, right now it escapes me), I've been doing a ton of searching but everything I found was for either Sugarcube 1, twine 1, or not explanatory enough. I can't find anything about images in the sugarcube 2 documentation, mostly just audio related stuff on there for some reason.

Like where do I link them? How do I link them?

I already asked about how to make a simple code for choosing an image based on some variables but this problem is so much simpler, isn't it? How do I get the image into the thing! The code and whatnot, whatever it's called.

How do you rename the image url so that it still works and the help I got from greyelf on the avatars and such also works.

I know how to make an image a background but I don't know how to get all the images to just load up somewhere and get ready until they're needed. It feels like herding cats!

Ugh, this is probably the stupidest thing yet on this site but please help me. I am not the brightest about these things, so please walk me through it, thank you. Sorry if this is incoherent, it's been a long night.

1 Answer

+3 votes
by (154k points)
selected by
 
Best answer

When you use the Publish to File option to create your story HTML file you save that file within a folder. If you store your images files within the same folder then your story HTML file can access and display those images.

eg. If you save your story HTML file as MyStory.html in a folder named C:\MyStory and also store an image named character-portrait.jpg in the same folder then you can use Image Markup like the following to display the image.

[img[character-portrait.jpg]]

If you want to be more organised you could store the image in folder named C:\MyStory\images while still saving the MyStory.html in the C:\MyStory folder, and then use markup like the following to display it.

[img[images/character-portrait.jpg]]

note: Remember to include the images when you supply the story HTML file to others.

by (120 points)

This does not seem to work with me. 

I have the project folder in Desktop, I tried these two codes: 

[img[Desktop/TwineProject/image.png]]
[img[TwineProject/image.png]]


None is working.

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.
...