Indent paragraphs in Quest

Hi all.

Is there a way to add an indent for paragraphs in Quest? When play testing, any indents I've attempted (with spaces only) are made to justify left.

So when I typed this:

  This is a paragraph. It has two to three sentences. It contains several sentences to form a paragraph. Sometimes, you have more than one thing to say on the subject, but it can be better to form it in a group setting, then separate with another thought, as you continue the topic at hand.

I get this on playing the game

This is a paragraph. It has two to three sentences. It contains several sentences to form a paragraph. Sometimes, you have more than one thing to say on the subject, but it can be better to form it in a group setting, then separate with another thought, as you continue the topic at hand.

I was wondering if there was a way around this or just something I'll have to live with? Any help is appreciated


Sorry for the sub par grammar on my examples, I was just using filler text.


Whitespace is ignored on webpages. Any number of spaces, linebreaks, or other whitespace characters are treated like a single space.

If you want to add whitespace, you'll have to use HTML or CSS styling.

If you want to indent one paragraph, you could use a blank image. For example, entering this:

<img style="width: 1em">Here's a paragraph with a space in front of it. The width is given as "1em", which is the width of a letter 'm', but you could just as easily say '2en' for the width of 2 'n's, or 1cm, or 0.5in (but you should be careful about cm and inches, because you don't know what size the player's screen is)

and it will appear like this:
Here's a paragraph with a space in front of it. The width is given as "1em", which is the width of a letter 'm', but you could just as easily say '2en' for the width of 2 'n's, or 1cm, or 0.5in (but you should be careful about cm and inches, because you don't know what size the player's screen is)

If you want to indent all paragraphs, you could output this HTML:

<style>#divOutput > div {text-indent: 1em}</style>

Which won't appear on its own, but will make all paragraphs have a 1em indent until it's removed (for example by clearing the screen).

If you want to indent all paragraphs, then you could use Javascript to put it outside the output area. Then it would survive being cleared:

JS.eval("$('<style>').appendTo('head').text('#divOutput > div {text-indent: 1em}')")

That won't be affected by clearing the screen, but won't be preserved when the game is saved; so if you're making a text adventure, you'd want to put it in the 'UI initialisation' script (on the Advanced Scripts tab), which is run at the start of a new game or when a saved game is loaded; then it will always be in effect.

(EDIT: fixed a silly mistake in the CSS)


I use &emsp;.

&emsp;This is indented.

This is not indented.

 This is indented.

This is not indented.


Looks like the img style only works. Style blanks out my text if anything inserted inside the start and end variables. The JS doesn't make anything happen, unfortunately.


&emsp; eh? That could work. Thanks, Richard. Rather not have to use it on every paragraph, of course, but that's a working solution at least. :D


Style blanks out my text if anything inserted inside the start and end variables.

You don't put text inside it. You print it out once and it affects all other text on the screen until it's deleted by clearing the screen.
Except I was half asleep when I wrote it, and there was a mistake in the CSS. I've edited the post above now.

The JS doesn't make anything happen, unfortunately.

Should be fixed; I edited the post above.


Quest 5.7 added a built-in function called Spaces() that inserts a number of &emsp; based on the integer argument inputted:

msg (Spaces(5) + "This is indented 5 spaces.")

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums