It looks like you're new here. If you want to get involved, click one of these buttons!
/* Your story will use the CSS in this passage to style the page.
Give this passage more tags, and it will only affect passages with those tags. */
/* Plain Sugarcane Stylesheet version 1.03 by Richard D. Sharpe, Dec. 30, 2013 */
body {
/* This affects the entire page. */
/* Remove default styles */
color: black;
background-color: transparent;
margin: 0;
}
#sidebar {
/* This affects the Sugarcane sidebar */
/* Removes the Sugarcane sidebar */
display: none;
}
#passages {
/* This is a container for all passages displayed on the page */
/* Removes the vertical line to the left of Sugarcane passages */
border: 0;
/* Removes the space left from removing the Sugarcane sidebar */
margin: 0;
/* Creates space between the passage and the top and bottom of the page */
padding-bottom: 5%;
padding-left: 0;
padding-right: 0;
padding-top: 5%;
}
.passage {
/* This only affects passages */
/* Passage width */
width: 640px;
/* Passage height */
height: auto;
/* Centers the passage horizontally */
margin-left: auto;
margin-right: auto;
/* Padding */
padding-top:25px;
padding-bottom:25px;
padding-right:50px;
padding-left:50px;
/* Text formatting */
font-style: normal;
font-variant: normal;
font-weight: normal;
font-stretch: normal;
font-size: medium;
line-height: normal;
font-family: sans-serif;
/* Sets a border around the passage */
border-style: solid;
border-width: 1;
/* Sets the passage background color */
background: transparent;
}
.passage a {
/* This affects passage links */
color: #4169E1;
}
.passage a:hover {
/* This affects links while the cursor is over them */
color: #6495ED;
}
Comments
The Dumb Terminal Stylesheet for Sugarcange is more than just a stylesheet. It includes HarmlessTrouble's <<textinput>> macro and his code to display a new region outside the passage to show information such as text, pictures and variables to the player. It also includes a Code Page 437-style font.
However, for this version, 1.0, I was unable to figure out how to properly center the two CSS elements, .passage and .storyRegion., which are both floated left. So, I set fixed widths. Someday, I'll figure it out and update this stylesheet. For now, it's good enough.
Download the story file for all the stylesheet, scripts and passages required to make it work.
Enjoy!
If you figure out how to correctly center two elements that are floated left, let us all know. I just don't feel like spending more time on it right now.
On my list of things to do: make another stylesheet that uses frames that will serve much the same purpose as multiple passages, but will be fully controlled by CSS and easily legible.
is the only way to alter this by adding new IF statements in "Box"?
I'm pretty sure there must be a special tag I should use. I see Box has the "StoryRegion" tag but, how would it differentiate it from any other StoryRegion Passage?
Thanks!
There is only one passage with the StoryRegions tag, and that's the passage that's displayed by the script module. I've never tried to tag more than one passage. Have no idea what that would do. Probably error.
Creating another passage with the StoryRegion tag creates another box besides the first box. So there are two boxes simultaneously displaying.
Also, the code in the Update Regions passage if you want the passage to immediately change.
However, I believe there are macros out there that mess with tags. So, if you can change the tags of passages, you can change the display of what's in the StoryRegion that way as well.
Thanks Sharpe. I'm using it as character portraits for dialogue.
However, I'd probably do that with frames. The CSS would be more complex, but the result would be more customizable and the appearance benefits might be worthwhile.
I'm trying to find time to make a basic frames template. I have one started, but boy, is it ugly. I'll attach it so you can see what I mean, but note that it's far from finished and I still can't figure out how to center three elements floated left in Twine. The contrasting colors are in place to show what is what in Twine. With some imagination, one can see just how creatively frames can be used, especially for things like dialog boxes with portraits, maps for places, pictures of enemies or objects, etc.
Again, the attached stylesheet is no where near finished.
Here's a stylesheet I worked on today in an attempt to understand the border-image CSS property. Long story short, I failed to wrap my brain around it before my attention span ran away. However, the results in Firefox and Chrome were acceptable, so I thought I would share.
The parchment and border are seamless and scale with the browser window's size. That was the core functionality I sought when making this. Otherwise, I would have just used a background image and set fixed height and width! No matter how wide, thin, long or short, the passage is, the parchment and border scales with it. I did set a minimum width and height, but that can be removed if desired.
Unfortunately, this stylesheet does not work in Internet Explorer at all, apparently, though the newest version (11) should recognize border-image. IE 10 and earlier versions do not. If anyone wants to inform me what I'm doing wrong and help me better understand image-border, I'd appreciate it. (EDIT: Actually, it's the font that's causing problems in IE only. Strange. I even ran it through a converter . . .)
I hand drew the border image with a mouse in GIMP then added a filter or two, so it could use a lot of work to make it look more realistic. In fact, a lot could be done to make this look better. Someday, maybe I'll make a better-looking version.
Until then, but especially until I get this working in IE, this is more of a proof of concept than a release. If anyone wants to help, by all means, let me know!
The parchment background is 156KB and the border is 24KB. Therefore, I compressed the TWS and HTML files and added them to Dropbox:
https://dl.dropboxusercontent.com/u/34725588/Bloody%20Parchment.rar
Bloody Parchment:
Fixed Dimensions
(Coming Soon)
Now this is more like it! When I throw out the scalability, I can make the parchment look a lot better and also use a body background image rather than the black required in the regular version of this stylesheet. There's still a lot of work that can be done, though.
I made the parchment from scratch in GIMP in about ten minutes. If I spent some time with some grunge brushes, I could really bring it out.
Again, though, I found out the problem in IE was with the font. I copy and pasted each individual passage into a new TWS one by one until IE crashed. The only one that caused a problem was the imported font.
When I select a new font and finish the parchment, I'll upload new versions of both stylesheets. Both work in the current versions of Firefox, Chrome, and IE, but the regular version will not work in IE 10 or lower. Notice I said IE 10, not IE 9 or IE 8, which is to be expected. It's disheartening that IE 10 doesn't support border-image.
In the future, I plan to add some stains and blood spatters in random locations on both versions. So, each time the page is turned, it will look different.
What I did was use JavaScript to create a new div which had the main passage window and the secondary display window as child elements. I placed this code as a
<<script>>
in theStoryInit
passage, and I'm not sure if it will work in a normalscript
passage. Depending on how you have the second display window set up, you will need to change "secondary-display" in the firstif
statement to whatever id is associated with the window (if the window does not have an id, but rather just a class, I think you can change "id" to "class" indivs[ i ].getAttribute("id")
, which should work).Once the two windows are wrapped in the "container" div, use the following CSS. The
width
will depend on how you've set up the width of the whole page and other elements - you might need to play about with it to get the exact positioning.You will also need to set the
width
in#passages
and whatever id is associated with the secondary display window. Again, you might need to play about with the values somewhat to get the exact positioning.I've attached the Twine file so you can see precisely what it is I'm doing - you'll need the Sugarcube header for it to work properly, but hopefully it'll provide some ideas as to how to center the elements in Sugarcane.
I'm a bit the same- playing around, certainly no expert. I like the stripped down version because it plays well on a mobile phone. the one change I made was to make it so it wraps nicely on whatever device you use.
Rather than having a fixed width of 640px, I wrote
width: 85%;
max-width:640px;
Does anyone else have tips on making it work well on little screens?
A very basic example. I suggest you search CSS @media in the search engine of your choice for more information.
Was it taken down?