I want to resize the header that has the title and author and whatnot. How do I do that?
Resize how? Do you mean the font size? Or do you want to make the bar itself wider or something?
tritwo1 wrote:
Or how do I make the text in the passages scrollable?
Which passages? Are we still talking about the title area or something else?
Basically I'm testing it on my phone and finding that the Title, Author and Saves/Restart are taking up a lot of screen-space. And I can't scroll the text to read what's being cut-off at the bottom. So how do I either make those things at the top I mentioned smaller, or make the text scrollable so I can read it all?
Basically I'm testing it on my phone and finding that the Title, Author and Saves/Restart are taking up a lot of screen-space. And I can't scroll the text to read what's being cut-off at the bottom. So how do I either make those things at the top I mentioned smaller, or make the text scrollable so I can read it all?
Do you know the width of your viewport/screen? Is the ui-bar on the left-side or the top of the view (normally, it's on the left side, for narrow viewports it switches to the top)? And what is being cut-off, the contents of the bar or the main passage text? Since the main passage text should always be scrollable, I'm guessing the bar?
I'm just trying to get a mental map of what's going on, because it sounds like you're seeing something that you shouldn't be. Screenshot?
The ui-bar is relatively positioned at that point. It and the main passage container should scroll up just as a normal HTML page would at that point (since that's essentially how they're both configured then). That view looks a mite narrow for an iPhone 5 (at least, if the scaling is working; is that zoomed in?), but that shouldn't make a difference, regardless. I'm going to need to look into the scrolling issue, because I can't think of a reason that would be happening.
Beyond that, you can halve the dead space between the title group and footer with this style: (put it in a stylesheet tagged passage)
The ui-bar is relatively positioned at that point. It and the main passage container should scroll up just as a normal HTML page would at that point (since that's essentially how they're both configured then). That view looks a mite narrow for an iPhone 5 (at least, if the scaling is working; is that zoomed in?), but that shouldn't make a difference, regardless. I'm going to need to look into the scrolling issue, because I can't think of a reason that would be happening.
Beyond that, you can halve the dead space between the title group and footer with this style: (put it in a stylesheet tagged passage) @media screen and (max-width: 800px) { #ui-bar footer { margin-top: 1.5em; } }
That will gain you back some space for the main passage container when in that configuration.
It's not zoomed in. It's just Titanium's simulator of the phone (but the problem is the same when testing on an actual phone I've tried). One detail I've noticed that might hint at the source of the problem: the time and battery power are still displayed at the very top of the phone, kinda going over the "Saves" button. So maybe it's running behind that and I can't click anything because of that?? I have no idea if that makes sense nor how to fix that if that's the case.
I tried adding that stylesheet passage and it added one more line of text to the screen at the bottom (when i made the number 0.5, just to squeeze as much as i can out of it). Thanks! Maybe I can make the title and author font size smaller too to help, if you can easily help me with that. Basically anything I can do to get more room would be great if the scrolling issue can't be fixed.
Ahhhh I'm so sorry for the trouble. It works like a charm. I had found this script on the internet as part of a tutorial on turning twine games into web-based apps and looking at it closely what it was doing was turning off the touch-input. I have no idea why anyone would want to turn that off maybe someone was just trolling me :c
in any case, I'm sorry to have taken your time and SugarCube rocks
I was using that and someone else's code. This one, GritFish's, is good, and he'll help you out if you reach out to him, which I did and he's awesome. The other code that was bad was from this tutorial saying make a script passage with it and then when you visit the story on a webpage, you can click on an iOS share button and pin it to the home menu as an app (that basically just loads the webpage). If anyone finds that tutorial, I recommend not using it.
Thanks so much for implementing the auto-autosave loading capability. I hope that people many people use it and that not-fiddling-with-saves becomes a widespread Twine feature (or at least Twine+SugarCube) feature!
Quick question: My WIP has lots of custom CSS work--35,000 characters or thereabouts--and I don't really want to upgrade from v0.9.9 to a bunch of CSS debugging. Is most of the style work confined to the hardcoded CSS in the sugarcube header file? In other words, can I avoid such trouble by patching the file manually (i.e., copying the v0.9.9 CSS style block(s) and pasting them over the 1.0.4 block(s)?
A lot of the styles are the same between v0.9.9 and v1.x, so it may not be as bad as you fear. Many of the changes were additions and the separation of the old monolithic style into groups. The biggest changes to the styles themselves were to:
Regardless, there would be issues going either way (making your CSS v1.x-compatible or trying to back-port the v0.9.9 CSS to v1.x). Off-hand, I can't say which would be more of a hassle. I'd test your CSS with an unaltered v1.x first, before trying the other way. I am, also, here to help.
OK, I'm giving the straight upgrade a shot. It seems that the major problems are: my custom font declarations get stomped on, and the initialization bar at startup is off-center. Shouldn't be too hard to clean up. I'll let you know if I run into anything I can't figure out.
Added the ability to build user library code into the compiled HTML via the file userlib.js, which must exist within SugarCube's directory under targets.
Added helper methods to UISystem for each built-in menu, which populate and open the menus in one easy call.
Added the predisplay and postdisplay task objects, which are similar to prerender and postrender task objects but are executed subsequent to the PassageReady and PassageDone special passages, respectively. See Task Objects for more information.
Interesting. Does the introduction of the predisplay and postdisplay tasks mean that the corresponding special passages will eventually be phased out, or are they just for added flexibility?
Added flexibility. I have no intention of removing the PassageReady and PassageDone special passages.
[EDIT]: If I ever did decide to retire those specific special passages, it would likely be in favor of making them tag-based rather than specially titled passages, so you could have multiples of each. Something like that. I have no such plans at the moment, however.
Added a new config property config.altPassageDescription, which allows authors to specify alternate passage descriptions; used by the Saves and Rewind menus.
Added additional ARIA landmark roles to various core elements.
Changed <History>.isEmpty from a getter to a method, <History>.isEmpty(). This is a breaking change.
Some internal refactoring. This shouldn't affect authors, however, note is being made of it, just in case.
Other improvements.
Updated jQuery.
Also, as a reminder, the handling of the StoryMenu special passage will be changing in the near future. If you're using it to hold non-menu content, it is strongly suggested that you move said content to another location (e.g. to the StoryCaption special passage).
@text@@ and table cell markup.[*]Modified how line feeds are handled by the nobr tag and <<nobr>> macro. Preceding and trailing line feeds are now completely removed and contiguous line feeds are compressed into a single space.[*]Added the <Array>.count() & <String>.count() extension methods, which return how many times the needle was found in the haystack.[*]Removed the body ID from the <body> tag. This likely affects very few projects.[*]Some internal refactoring. This shouldn't affect authors, however, if you do notice a regression, let me know.[*]Other improvements.[*]Initial Twine 2.x support (installation URL TBD).
Also, as a reminder, the handling of the StoryMenu special passage will be changing in the near future. If you're using it to hold non-menu content, it is strongly suggested that you move said content to another location (e.g. to the StoryCaption special passage).
What method did you use to get around the lack of StoryInit, StorySettings, StoryMenu, etc.... in Twine 2?
I didn't. Aside from decorating their icons in the story map, most pre-Twine 2 special passages aren't related to or dependent on the editor/compiler at all (e.g. Twee vs. Twine 1). The sole exceptions are StorySettings (Twine 1 only) and StoryIncludes (all pre-Twine 2 compilers). StorySettings isn't used by SugarCube, as its config object existed long before StorySettings did. StoryIncludes isn't used by story formats at all, it's solely for the compilers.
So, a few exceptions aside, special passages are used by the story format and the editor/compiler used is irrelevant. This is also the reason why SugarCube has more special passages than the Twine 1 vanilla story formats do.
That said, the current version of SugarCube for Twine 2, which will likely see some additional development, does make some concessions to Twine 2. Notably: [list type=decimal] It does not process stylesheet or script tagged passages, in favor of the "Story Stylesheet" and "Story JavaScript" mechanisms from Twine 2 (which are really just special passages in their own way). The former is not going to change ("Give me a stylesheet, Vasili. One stylesheet only, please."). The latter I'm of two minds about, so I might be convinced to allow script tagged passages in addition to the "Story JavaScript". It does not automatically treat the Start passage as special. Currently, only if the author fails to mark a passage as the starting passage (via the rocket ship icon) does SugarCube treat an existing Start passage as the starting passage, otherwise it's treated as a normal passage. I'm not actually sure how Harlowe or Snowman for Twine 2 handle the failover state, I'm guessing they simply pick the first passage (pid === 1). I might have SugarCube do that too in case of double failover (i.e. no chosen starting passage and no Start passage). As noted above, StoryIncludes simply doesn't work, because Twine 2 doesn't support it. Not actually SugarCube related, but still something to keep in mind for authors familiar with SugarCube from pre-Twine 2.
Beyond that, SugarCube works pretty much the same in Twine 2 as it does in Twine 1 (or Twee, or TweeGo).
Changed the handling of the StoryMenu special passage. Rather than simply being dumped into a single element in the core menu, it is now fully processed into its own menu, which is a sibling of the core menu.
Changed the previous() function to behave like its vanilla counterpart when called without an argument (behavior with an argument is unchanged).
Fixed an issue with the built-in seedable pseudo-random number generator when using custom seeds without extra entropy.
Added support for arrow separators (-> & <-) in the core section of wiki links and images (Twine 2 extension, though it works in Twine 1 as well).
How to install SugarCube on Twine 2 ? I copied SugarCube into storyformats folder but it not appear on Twine 2 story format window. I searched and found nothing.
In the Twine 2 sidebar there is a Formats link, click on it, then click on the tab Add a New Format, finally paste the URL given here into the appropriate spot and click the +Add button.
Fixed an issue with macro argument parsing which would cause it to fail on quoted strings if the string contained an escape for any character other than the quote.
Added the <<textarea>> and <<goto>> macros.
Updated the heading markup formatter to be choosier about what constitutes a heading.
Changed the startup requirements so that the story title is no longer optional.
Other improvements.
Additionally:
Finally sync'd the <<replacelink>> macro set with v1.1.5 of the Combined Replace Macro Set and reuploaded it.
Comments
Resize how? Do you mean the font size? Or do you want to make the bar itself wider or something?
Which passages? Are we still talking about the title area or something else?
Basically I'm testing it on my phone and finding that the Title, Author and Saves/Restart are taking up a lot of screen-space. And I can't scroll the text to read what's being cut-off at the bottom. So how do I either make those things at the top I mentioned smaller, or make the text scrollable so I can read it all?
Do you know the width of your viewport/screen? Is the ui-bar on the left-side or the top of the view (normally, it's on the left side, for narrow viewports it switches to the top)? And what is being cut-off, the contents of the bar or the main passage text? Since the main passage text should always be scrollable, I'm guessing the bar?
I'm just trying to get a mental map of what's going on, because it sounds like you're seeing something that you shouldn't be. Screenshot?
[URL=http://s1089.photobucket.com/user/tritwo1/media/ScreenShot2014-10-05at83339PM.png.html][IMG]http://i1089.photobucket.com/albums/i349/tritwo1/ScreenShot2014-10-05at83339PM.png[/img][/URL]
Beyond that, you can halve the dead space between the title group and footer with this style: (put it in a
stylesheet
tagged passage) That will gain you back some space for the main passage container when in that configuration.It's not zoomed in. It's just Titanium's simulator of the phone (but the problem is the same when testing on an actual phone I've tried).
One detail I've noticed that might hint at the source of the problem: the time and battery power are still displayed at the very top of the phone, kinda going over the "Saves" button. So maybe it's running behind that and I can't click anything because of that?? I have no idea if that makes sense nor how to fix that if that's the case.
I tried adding that stylesheet passage and it added one more line of text to the screen at the bottom (when i made the number 0.5, just to squeeze as much as i can out of it). Thanks! Maybe I can make the title and author font size smaller too to help, if you can easily help me with that. Basically anything I can do to get more room would be great if the scrolling issue can't be fixed.
in any case, I'm sorry to have taken your time and SugarCube rocks
Is this the article you were using?
I was using that and someone else's code. This one, GritFish's, is good, and he'll help you out if you reach out to him, which I did and he's awesome. The other code that was bad was from this tutorial saying make a script passage with it and then when you visit the story on a webpage, you can click on an iOS share button and pin it to the home menu as an app (that basically just loads the webpage). If anyone finds that tutorial, I recommend not using it.
config.saves.autoload
property.Quick question: My WIP has lots of custom CSS work--35,000 characters or thereabouts--and I don't really want to upgrade from v0.9.9 to a bunch of CSS debugging. Is most of the style work confined to the hardcoded CSS in the sugarcube header file? In other words, can I avoid such trouble by patching the file manually (i.e., copying the v0.9.9 CSS style block(s) and pasting them over the 1.0.4 block(s)?
- The #ui-bar's style.
- How <body>, #ui-bar, and #passages interact.
- The narrow-viewport @media query styles.
Regardless, there would be issues going either way (making your CSS v1.x-compatible or trying to back-port the v0.9.9 CSS to v1.x). Off-hand, I can't say which would be more of a hassle. I'd test your CSS with an unaltered v1.x first, before trying the other way. I am, also, here to help.userlib.js
, which must exist within SugarCube's directory undertargets
.UISystem
for each built-in menu, which populate and open the menus in one easy call.- Added the
- Added the
- Other improvements.
From v1.0.61.0.8:autofocus
keyword to the<<textbox>>
macro.predisplay
andpostdisplay
task objects, which are similar toprerender
andpostrender
task objects but are executed subsequent to thePassageReady
andPassageDone
special passages, respectively. See Task Objects for more information.config.saves.autoload
for details.config
object with a newstrings
object. See the upgrade instructions page for details.PassageReady
andPassageDone
special passages.[EDIT]: If I ever did decide to retire those specific special passages, it would likely be in favor of making them tag-based rather than specially titled passages, so you could have multiples of each. Something like that. I have no such plans at the moment, however.
- Added a new config property
- Added additional ARIA landmark roles to various core elements.
- Changed
- Some internal refactoring. This shouldn't affect authors, however, note is being made of it, just in case.
- Other improvements.
- Updated jQuery.
Also, as a reminder, the handling of theconfig.altPassageDescription
, which allows authors to specify alternate passage descriptions; used by the Saves and Rewind menus.<History>.isEmpty
from a getter to a method,<History>.isEmpty()
. This is a breaking change.StoryMenu
special passage will be changing in the near future. If you're using it to hold non-menu content, it is strongly suggested that you move said content to another location (e.g. to theStoryCaption
special passage).@text@@ and table cell markup.[*]Modified how line feeds are handled by the nobr tag and <<nobr>> macro. Preceding and trailing line feeds are now completely removed and contiguous line feeds are compressed into a single space.[*]Added the <Array>.count() & <String>.count() extension methods, which return how many times the needle was found in the haystack.[*]Removed the body ID from the <body> tag. This likely affects very few projects.[*]Some internal refactoring. This shouldn't affect authors, however, if you do notice a regression, let me know.[*]Other improvements.[*]Initial Twine 2.x support (installation URL TBD).
Also, as a reminder, the handling of theStoryMenu
special passage will be changing in the near future. If you're using it to hold non-menu content, it is strongly suggested that you move said content to another location (e.g. to theStoryCaption
special passage).Twine 2.x installation URL:
http://www.motoslave.net/sugarcube/twine2/format.js
I didn't. Aside from decorating their icons in the story map, most pre-Twine 2 special passages aren't related to or dependent on the editor/compiler at all (e.g. Twee vs. Twine 1). The sole exceptions are
StorySettings
(Twine 1 only) andStoryIncludes
(all pre-Twine 2 compilers).StorySettings
isn't used by SugarCube, as itsconfig
object existed long beforeStorySettings
did.StoryIncludes
isn't used by story formats at all, it's solely for the compilers.So, a few exceptions aside, special passages are used by the story format and the editor/compiler used is irrelevant. This is also the reason why SugarCube has more special passages than the Twine 1 vanilla story formats do.
That said, the current version of SugarCube for Twine 2, which will likely see some additional development, does make some concessions to Twine 2. Notably:
[list type=decimal]
It does not process
stylesheet
orscript
tagged passages, in favor of the "Story Stylesheet" and "Story JavaScript" mechanisms from Twine 2 (which are really just special passages in their own way). The former is not going to change ("Give me a stylesheet, Vasili. One stylesheet only, please."). The latter I'm of two minds about, so I might be convinced to allowscript
tagged passages in addition to the "Story JavaScript".It does not automatically treat the
Start
passage as special. Currently, only if the author fails to mark a passage as the starting passage (via the rocket ship icon) does SugarCube treat an existingStart
passage as the starting passage, otherwise it's treated as a normal passage. I'm not actually sure how Harlowe or Snowman for Twine 2 handle the failover state, I'm guessing they simply pick the first passage (pid === 1
). I might have SugarCube do that too in case of double failover (i.e. no chosen starting passage and noStart
passage).As noted above,
StoryIncludes
simply doesn't work, because Twine 2 doesn't support it. Not actually SugarCube related, but still something to keep in mind for authors familiar with SugarCube from pre-Twine 2.Beyond that, SugarCube works pretty much the same in Twine 2 as it does in Twine 1 (or Twee, or TweeGo).
http://www.motoslave.net/sugarcube/twine2/format.js
)Changelog highlights:
StoryMenu
special passage. Rather than simply being dumped into a single element in the core menu, it is now fully processed into its own menu, which is a sibling of the core menu.previous()
function to behave like its vanilla counterpart when called without an argument (behavior with an argument is unchanged).->
&<-
) in the core section of wiki links and images (Twine 2 extension, though it works in Twine 1 as well).Formats
link, click on it, then click on the tabAdd a New Format
, finally paste the URL given here into the appropriate spot and click the+Add
button.Changelog highlights:
Changelog highlights:
<<replace>>
macro where it did nothing when used empty, rather than emptying its targets.@@@@
). It may now produce either an inline (<span>
) or block (<div>
) level element.Changelog highlights:
- Fixed an issue with macro argument parsing which would cause it to fail on quoted strings if the string contained an escape for any character other than the quote.
- Added the
- Updated the heading markup formatter to be choosier about what constitutes a heading.
- Changed the startup requirements so that the story title is no longer optional.
- Other improvements.
Additionally:<<textarea>>
and<<goto>>
macros.<<replacelink>>
macro set with v1.1.5 of the Combined Replace Macro Set and reuploaded it.