Yet another "this worked in Sugarcane but not in SugarCube" threads, sorry. I have a whole lot of styles that I defined in order to change the font color of specific words. For example:
.forest {
font-size: 1.5em;
color:darkgreen;
}
And then I use it in a passage like this to turn "forest" the forest color:
Does this syntax not work in SugarCube? I know I could apply it to an entire passage by using tags, but there are some cases where I need to apply it only to a single word or phrase within a passage. How do I do that?
I'm also running into an issue where I tagged some of my passages in order to apply styles, but now suddenly none of the links in one of my other passages will respond. They're colored like links, but clicking on them does nothing. What's going on?
Honestly, SugarCube is even more opaque to work with than Sugarcane, whose documentation seems to be all over the place, but I really want the saving functionality, so I'm trying to get the rest of what I'm doing working.
Edit: I should specify that the passages that don't work are all ones that contain setter links, of the form [[Do Something|Do Passage][$i = $i + 1]]. Does that syntax also not work in SugarCube? According to the SugarCube docs page (
http://www.motoslave.net/sugarcube/docs/), that syntax should work, so why are these passages broken?
Comments
@ styling shortcut, so you need to add the <span> tag yourself. SugarCube expects all variables to be assigned a value before they are used in arthritic or used in a comparison, are you sure you assigned a value to $i before using it in the link [[Do Something|Do Passage][$i = $i + 1]]
The following code works for me using SugarCube:
I never thought about initialization since Sugarcane was so cavalier about it, but it's probably better practice to make sure to initialize, so I'll do that and that will probably fix the problem.
Thanks!
@ style syntax is only a relative recent addition to Sugarcane and was never in SugarCube.