Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How to change images every passage?

I'm trying to set up sort of a visual novel on Twine, where every passage has a different image on the top. I'm using L's "Earth's Story Illustrated" stylesheet, ( Link: http://www.glorioustrainwrecks.com/node/5163) as it looks the best for this, and I can't seem to get it to change images reliably. I have tried tagging the stylesheet to certain passages, but even then, it will sometimes display images from different stylesheets despite the tags. I have tried using <style> to change the image for only one passage, but the image stays the same. I have tried using a "set background image" macro I found on here, but that just threw error messages everywhere and completely didn't work. I really have no idea how to do this.

I'm seriously at my wit's end here. Is this just impossible to do on Twine? Anyone know what I'm supposed to be doing?

If it helps, I'm using Sugarcube.

Comments

  • Assuming you meant SugarCube, not Sugarcane, then from the very first line of the link you provided:
    [quote]These are some CSS snippets that alter the Sugarcane format.

    Hopefully, you see the problem.  You're trying to fit a round peg into square hole.


    To get that working properly in SugarCube you will need to:

    1. Change the following "The Earth's Story Illustrated" styles:

    FIND:

    a.internalLink, a.externalLink {
    border-bottom: solid #fff 1px;
    color:#eee;
    font-weight:normal;
    }
    a.internalLink:hover, a.externalLink:hover {
    text-decoration:none;
    border-bottom: none;
    color:#000;
    background-color:#fff;
    font-weight:normal;
    padding-left: 0;
    }
    a.internalLink:active, a.externalLink:active {
    border-bottom: 0;
    }
    REPLACE WITH:

    a.link-internal, a.link-external {
    border-bottom: solid #fff 1px;
    color: #eee;
    font-weight: normal;
    }
    a.link-internal:hover, a.link-external:hover {
    text-decoration: none;
    border-bottom: none;
    color: #000;
    background-color: #fff;
    font-weight: normal;
    padding-left: 0;
    }
    a.link-internal:active, a.link-external:active {
    border-bottom: 0;
    }

    2. SugarCube doesn't support tagged stylesheets.  In SugarCube, you simply use the passage tags as classes in your stylesheet selectors.

    For example, if you had tagged some passages with "classroom" and others with "hallway", then the background image styles might look like this:

    .passage.classroom .header {
    background-image: [img[classroom]];
    }
    .passage.hallway .header {
    background-image: [img[hallway]];
    }
    Et  cetera.
  • Thank you! Seriously, thank you. I knew I was doing something wrong, but I didn't know what. I didn't know that Sugarcube didn't support tagged passages, and with the exception of the link colors, the stylesheet seemed to work exactly the same as in Sugarcane, so I didn't notice that there was a compatibility problem. I don't know much about coding, so Sugarcube and Sugarcane seem very similar to me. I'm very new, so sorry for my really dumb mistake. I'll definitely fix the stylesheet, and I'll test the pictures later!

    Thank you!
Sign In or Register to comment.