Quantcast
Channel: Help! with 2.0 - Twine Forum
Viewing all articles
Browse latest Browse all 1844

Twine 2, SugarCube 2: Can I change the styling of the sidebar on specific passages?

$
0
0


tl;dr

Twine 2, Sugarcube 2.5. I need to make the sidebar's background change for some passages. If that requires me defining a specific thing on all 125 current passages, so be it. If I could just add code for passages where I want it to look special, that'd be ideal, but whatever.
What do I need to do to get that to work?


Hi. I've searched around, and not found anything, maybe because "sidebar" and "css" are such often used terms, but, I hope this hasn't been asked a ton of times or anything.

I'm using the most recent version Twine 2. I'm using SugarCube 2.50, as I literally just looked and saw that there has been an update, updating offline last time was a whole thing and I had issues with it, and...
"Moved the core font and color properties from the body to the html element"
... seems like it might be bothersome, I'm not entirely sure, but I have <<toggleclass "body" "whatever">> on every passage, as I change the background quite a few times based on the lighting of the room the player is in.

Anyways, that's what I'm using.

So, in general, before, I didn't really mind that the sidebar stayed the same while the background changed. The sidebar actually functions as a physical part of the room the player is in, and has a number of buttons on it. They can be darkened, when they're inactive, or later, light up, when they are able to be interacted with. As they are confined to a single space, what's on the sidebar works well as far as form and function, and when I have the background go black, for example, when the sidebar remains the same consistent "grey," that can generally be forgiven.

However, this one bit of the game I'm working on, this is what I need, or otherwise, I need to write a new idea. The room gets darker, and darker, and darker. Simultaneously, the buttons get darker, and darker, and darker. After the room is completely black, one shines, super brightly, and hurrah, the player presses it. I can get the buttons, w/e, no problem. Making the background, and fonts used, not an issue, i just do the above <<toggleclass "body" "button2dark3">> or whatever.

The sidebar refuses to get darker, though. Be it toggling it, or adding a class, or, not defining a color for the sidebar, and then adding a class, I can't get it to change, besides making it make a universal change, which doesn't help at all..

This might be super obvious with CSS; I'm self taught from just picking apart code, and while I can actually do this like, professionally, using my own, very likely messy Frankenstein code, I am by no means an expert, and specifically through Twine, I've found very basic things pop out that I should just inherently know and don't. This might be a super obvious SugarCube thing that I'm missing, but I've read the hell out of the documentation and still haven't found a way to do this. This might just be impossible to do and I should know that, buuuuut I'm hoping it isn't, so I'm asking here.

Thank you!

Viewing all articles
Browse latest Browse all 1844

Trending Articles