0 votes
by (230 points)
Heyho,

i am using Twine 1 with sugarcube 2 and want to change a background for only 1 passage but i dont get how i do it. I want to use a backgound the player get in external image file not a random internetlink(like all the other images). I dont understand how i have to do it. Its my first "programming" what i do in my Life so it would be pretty nice if you can help. Step by Step would be perfekt.

 

have a nice day

Gromo

1 Answer

0 votes
by (63.1k points)

Provided you are using SugarCube and not Sugarcane, getting tag-based styles is the same regardless of the Twine app/compiler you're using. So just add some tag to the passage you want to have a unique bagkground, say `forest`, and enter this in your CSS code:

body.forest {
    background-image: url('some/url/to/image.png');
}

You may want to add a few extra rules based on your needs, e.g.

body.forest {
    background-image: url('some/url/to/image.png');
    background-attachment: fixed;
    background-size: cover; /* or 'contain', based on your image */
    background-repeat: no-repeat;
}

More:

http://www.motoslave.net/sugarcube/2/docs/#markup-image

http://twinery.org/questions/1688/how-to-add-images-gifs-as-backround-in-sugarcube-2

https://twinery.org/wiki/twine2:add_an_image_movie_sound_effect_or_music

https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_is_a_URL#Absolute_URLs_vs_relative_URLs

...