Twine Version: 2.10.0
[also choose a Story Format tag above] Sugarcube 2.37.3
Can anyone show me how to add CSS to Stylesheet section and then correctly use that in one particular passage to make an image fullscreen?
Twine Version: 2.10.0
[also choose a Story Format tag above] Sugarcube 2.37.3
Can anyone show me how to add CSS to Stylesheet section and then correctly use that in one particular passage to make an image fullscreen?
I found this, but I donāt know how to apply it (hook up the plumbing, so to speak) in Twine Sugarcube.
the body and html tags still exist in twine, so you could try pasting everything between the <style>
tags into your stylesheet (using your own image) and see what you get
If you want to add CSS code specifically for one (or more but not all) passage you can include it in:
<style>
in the relevant passages[data-tags~="The-Name-Of-The-Tag]"
in the StyleSheet:: StyleSheet
body[data-tags~="The-Name-Of-The-Tag] {
background: red
}
so, if I had the following CSS in the stylesheet section, would tagging desired passage with ābgā work?
.bg {
/* The image used */
background-image: url("images/bsod.gif");
/* Full height */
height: 100%;
/* Center and scale the image nicely */
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
You can but a better version in that case would still be
body[data-tags~="bg"] {
/* Your code */
}
(so you attach it to the correct element too)
Works in Twee3 with Tweego, but not in App Twine. I must be overlooking somethingā¦
Okay, my images, relative to my compiled HTML game file, are located in subfolder images.
I have given the Story Stylesheet this code:
body[data-tags~="bsod"] {
/* The image used */
background-image: url("images/bsod.gif");
/* Full height */
height: 100%;
/* Center and scale the image nicely */
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
Then, I tag the desired passage with bsod
.
But itās not displaying the image.
The Desktop release of the Twine 2.x application creates a number of folders it uses internally to store things like: Project HTML files; Backup HTML files; the temporary Story HTML files generated by the Play and āTest relatedā options.
If you want your Relative URL referenced images to appear when the applicationās Play and āTest relatedā options are used them those images need to be stored relative to the temporary HTML files those options create, which are NOT the Project HTML files stored in the folder that is accessible via the applicationās View > Show Story Library toolbar options.
Because it can be difficult to store a projectās external media files relative to those generated temporary HTML files, the general advise is to:
On Windows, such a folder & file structure for a project named āadventureā could look something like:
c:\adventure\
images\
forest.png
home.png
audio\
bird-song.mp3
lawnmower.mp3
ā¦and the āpublishedā Story HTML file would be saved into the c:\adventure\
folder.
@Greyelf Thanks, thatās very interesting! Iām only publishing on the web for now, but Iāll definitely bookmark this for future reference
Potential solutions?
:: PassageName [tag]
).css
file or StyleSheet is not in the source folder)(itās a bit hard to say where something is wrong without having the files )