Howdy, Stranger!

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

Question about the automatic fade-in of text, images, and other elements (twine 2, sugarcube)

edited November 2015 in Help! with 2.0
First off, let me say that Twine's amazing. I experimented a lot with a much simpler choose-your-own-adventure-generator in high school which wasn't complex enough for me to even input variables. I wanted to write complicated stories so this meant a lot of jumping through hoops and beating my head into a wall. Twine 2 feels like a dream come true by comparison.

But my knowledge of HTML and CSS is rather limited. I'm using Sugarcube to build a game and not making many changes to the starting template. I did, however, place this box around the text in my story.
#storydiv {
    background: #000000;
		color: #C0C0C0;	
		border-style: double;
		border-width: 4px;
		border-color: #3E3E3E;
		margin-left: 10px;
		padding-top: 20px;
		padding-bottom: 20px;
		padding-left: 40px;
		padding-right: 20px;
		height: 400px;
		width: 620px;	
}

I notice there's a fade-in effect for this text container as well anything else I place in my pages (words, images, whatever). These elements fade in whether I play the game in test mode or try out the game-in-progress as an exported html file. While the built-in Sugarcube sidebar remains static as I click from page to page, the black box I've added fades in every time I click on a new link, which looks...odd. Is there a way to prevent this from happening by editing the story stylesheet right now, or do I need to wait until the game is finished and then dig into the actual html?

However, I do want the text and images to still appear by fading.

Thanks everyone! ! !

Seriously though, twine is great, just wanted to add that a second time

Comments

  • The HTML elements generated from a passage's contents get destroyed and recreated each time the Reader navigates from one passage to another, which combined with SugarCube's in-built styling is causing your #storydiv element to fade-out and then back in.

    One method you can use to get around this is to apply your CSS to the #passages element that wraps the generated passage contents, as this element does not get destroyed and re-created each time.
    Remove the #storydiv divs from your passage contents and change your CSS to use the #passages selector instead.
    #passages {
    	background: #000000;
    	color: #C0C0C0;	
    	border-style: double;
    	border-width: 4px;
    	border-color: #3E3E3E;
    	margin-left: 10px;
    	padding-top: 20px;
    	padding-bottom: 20px;
    	padding-left: 40px;
    	padding-right: 20px;
    	height: 400px;
    	width: 620px;	
    }
    
  • Thank you very much; that solved my problem and is also far less time consuming than typing "div" on every passage. :)
Sign In or Register to comment.