Howdy, Stranger!

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

Changing the background, is that possible?

Hello i am new here, i need to ask whether i can change the background or not. If so, is that possible if i change it to some pictures?

Thank you

Comments

  • You need to state which story format you are using when asking a question, as answers can be different for each one.

    Yes, you can change the background and yes, you can use images but the way you do it is slightly different for each story format which leads us back to my first statement.
  • I am using Sugarcube.
  • You can use the CSS background-color attribute to change the colour. Place the following CSS into your Story Stylesheet and it will change the background to darkblue, which you can test using either Twine 2's Test or Play option.
    body {
    	background-color: darkblue;
    }
    

    You can use the CSS background-image attribute you specify an background image. Replace the previous CSS with the following in your Story Stylesheet, it will use a forest.jpg image file as the background. You will need to use the Publish to File option to test this.
    body {
    	background-image: url("forest.jpg");
    }
    

    Now we come to the issue, and that is where to place the image file that is being used in the CSS and the answer is: In the same folder you saved the file created with the Publish to File option in.
  • Thank you so much for your help! :) One question, can the CSS hidden from the story if we play it? Because i don't want that to be shown in the story.
  • Oh wait, nevermind.
  • TheMHP wrote: »
    Thank you so much for your help! :) One question, can the CSS hidden from the story if we play it? Because i don't want that to be shown in the story.
    As I said in my earlier comment, the CSS goes in your Story Stylesheet, which can be access via the Edit Story Stylesheet menu option.
  • Hi all,
    This doesn't appear to work in Harlowe, and I haven't been able to get this other solution ( http://twinery.org/forum/discussion/2529/harlowe-1-0-1-javascript-dynamic-background-images ) to work either. Is there a way to do this?
  • Hi all, This doesn't appear to work in Harlowe
    Both of the CSS examples work with the version of Harlowe that comes with Twine 2.08 but as I noted in my previous comment the background image CSS version will only work correctly if you:
    a. Use the Publish to File option to save a story HTML file.
    b. The image file is located in the same location as the HTML file from point a.
    I haven't been able to get this other solution to work either. Is there a way to do this?
    That thread is about being able to dynamically change the background image while navigating a story, and it would be better to ask questions about it in that thread.
Sign In or Register to comment.