NoobLord here. I can't get audio to work at all. I tried many solutions online and I can't get anything to work. I have a few audio files that I would like to play on loop when certain passages are viewed. I also would like to know how to add images, and have a different style apply to certain slides. My game has two sections that are supposed to be entirely different, I have one stylesheet working but it obviously changes all slides where I only need it to cover half.
TLDR:
I'm super new, sorry
How do I add audio?
How do I add pictures?
How to have "multiple stylesheets"?
Sorry for asking super basic questions. Twine 2, Harlowe.
Comments
You don't actually need more than one stylesheet, instead you can use the technique described in the Basic Harlowe Passage Tag Based Styling thread to use Passage Tags and CSS selectors based on those tags to style some of your stories passages differently.
Once you have implemented Tagged based styling the actually CSS selectors you use depend on exactly which parts of a passage you want to style, but all the relevant tag-based selectors will start with html.<tagname> where <tagname> is replaced with the actual style tag name.
(note: the following examples assume that most of your passages have no style tag and that the ones you do want to style have been tagged with forest, the actual tags you use in your story are up to you.)
a. Background colour of the whole page: b. Changing the font size the passage text:
Audio and Image files:
The first issue you need to solve with both ot these external files types is where you are going to store/host the media (audio/image) files, and the first question you need to answer is are you going to host your story HTML file on a website or are you going to place the story HTML file into a ZIP (or another archive format) file and upload it to a file sharing site.
If you plan to host your story on a website then you need to determine if that website supports uploading media files, if it does then you will be hosting the media files there otherwise you will need to find somewhere else to host the media files.
If you place to use a ZIP file and a file sharing site then the media files will be contained within the same ZIP file.
A. Adding a image file to a Passage:
You use a standard HTML img element to display an image. ... depending on where you are hosting/storing the media files the element's src attribute will be either an absolute or relative URL.
B. Adding a audio file to a Passage:
You use a standard HTML audio element to play an audio file, you may need to include the same audio file in different formats so that it will play on all the different web-browsers. ... depending on where you are hosting/storing the media files the element's src attribute will be either an absolute or relative URL.
I hope the above is some help.