Difference between revisions of "Briefing Text"

From FreeSpace Wiki
Jump to: navigation, search
(Misc)
(Styling text in SCPUI)
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
These tags can be used to manipulate text messages in command and mission briefings. They don't work in debriefing stages.
+
These tags can be used to manipulate text messages in command and mission briefings, and the fiction viewer. As of r10846, they work in debriefings, too.
 +
 
 +
[[SCPUI]] has its own HTML-based syntax to styling text.
  
 
==Colors==
 
==Colors==
  
The hue of these colors can be changed with the [[Colors.tbl]] but the tags will remain the same.
+
The hue of these colors can be changed with the [[Colors.tbl]] but the tags will remain the same. As of r10926, the tags can also be customized.
  
A note about color tags: The color tag will work on all font until a space is encountered. There must also be a space after the tag and before the text to be colored. There is a method to color spans of text, which is discussed in the Misc section below.
+
A note about color tags: The color tag will work on all font until a space is encountered. There needs to be a space after the tag, before the text to be colorized (although it's not actually required after r5840, it is recommended due to the way FSO wordwrapping works). There is a method to color spans of text, which is discussed in the Misc section below.
  
 
Example: '$b This is $b blue $b text' will show as '<span style="color:#5D5D80">This</span> is <span style="color:#5D5D80">blue text</span>'
 
Example: '$b This is $b blue $b text' will show as '<span style="color:#5D5D80">This</span> is <span style="color:#5D5D80">blue text</span>'
Line 26: Line 28:
 
*'''<span style="color:#B99696">Pink</span>: $p'''
 
*'''<span style="color:#B99696">Pink</span>: $p'''
 
*'''<span style="color:#E6BEBE">Bright Pink</span>: $P'''
 
*'''<span style="color:#E6BEBE">Bright Pink</span>: $P'''
 +
*'''<span style="color:#FF7F00">Orange</span>: $o'''
  
 
==Misc==
 
==Misc==
Line 32: Line 35:
 
**$g Standard Green = '''<span style="color:#007800">Standard</span> Green'''.
 
**$g Standard Green = '''<span style="color:#007800">Standard</span> Green'''.
 
**$g Stand$|ard Green = '''<span style="color:#007800">Stand</span>ard Green'''.
 
**$g Stand$|ard Green = '''<span style="color:#007800">Stand</span>ard Green'''.
 +
***If the above causes wordwrapping oddness, you may want to write $g Stand$| ard Green (output is identical: '''<span style="color:#007800">Stand</span>ard Green''').
 
*$quote will create double quotes.
 
*$quote will create double quotes.
 
**Goober is $quotesilly$quote = Goober is "silly".
 
**Goober is $quotesilly$quote = Goober is "silly".
Line 39: Line 43:
 
*$f, $h, & $n will color the text with the default colors for Friendly, Hostile and Neutral respectively. The colors are defined in the [[iff_defs.tbl]].
 
*$f, $h, & $n will color the text with the default colors for Friendly, Hostile and Neutral respectively. The colors are defined in the [[iff_defs.tbl]].
 
*Most special characters such as the comma ',', question mark '?', and exclamation point '!' cannot be colored as of 3.6.14.
 
*Most special characters such as the comma ',', question mark '?', and exclamation point '!' cannot be colored as of 3.6.14.
*To color spans of text use $c{ and $c}.
+
*To color spans of text use $c{ and $}.
**The $y{ quick $g{ brown fox $r jumps over $g} the lazy $y} dog. = '''The <span style="color:#FFFF7A">quick <span style="color:#007800">brown fox <span style="color:#7E0606">jumps</span> over</span> the lazy</span> dog.'''
+
**The $y{ quick $g{ brown fox $r jumps over $} the lazy $} dog. = '''The <span style="color:#FFFF7A">quick <span style="color:#007800">brown fox <span style="color:#7E0606">jumps</span> over</span> the lazy</span> dog.'''
**This method requires FSO build 8784 or later.
+
**This method will color special characters such as the comma ',', question mark '?', and exclamation point '!'
 +
**This method requires FSO build 8786 or later.
 +
**As of r10846, color spans work across linebreaks as well (either manually-added, or automatic from wordwrapping).
 +
 
 +
==Styling text in SCPUI==
 +
 
 +
[[SCPUI]] has its own HTML-based approach to styling text. It works everywhere that classic color tags do - briefings (including command, loop, and red alert briefings), debriefings, and the fiction viewer - but also the tech room, campaign descriptions, and nearly everywhere that long-form text is supported. For it to work in briefings, the text must be put in "HTML mode" by putting <code>!html</code> at the start, followed by a space. Everywhere else will work without that tag.
 +
 
 +
Text in HTML mode may contain HTML markup. Text may be styled using <code>&lt;span&gt;</code> tags with appropriate classes drawn from common.rcss; inline styles are also supported. FSO and HTML both make use of double quotes and slashes; to minimize conflicts, using single quotes and writing slashes as <code>$slash</code> is recommended. A complete example might look something like this: <code>!html &lt;span class='white'&gt;Pilot attend!&lt;$slashspan&gt; Today, we'll be escorting the &lt;span class='green italic'&gt;GTC Examplar&lt;$slashspan&gt; as she raids &lt;span class='red'&gt;Shivan&lt;$slashspan&gt; positions throughout &lt;span class='yellow'&gt;Gamma Draconis&lt;$slashspan&gt;.</code>
 +
 
 +
It is, however, rarely necessary to perform simple styling like this manually: SCPUI's [[Keywords.tbl]] may be used to automate common styling rules.
  
 
[[Category:FRED Tips]]
 
[[Category:FRED Tips]]

Latest revision as of 16:12, 28 August 2024

These tags can be used to manipulate text messages in command and mission briefings, and the fiction viewer. As of r10846, they work in debriefings, too.

SCPUI has its own HTML-based syntax to styling text.

Colors

The hue of these colors can be changed with the Colors.tbl but the tags will remain the same. As of r10926, the tags can also be customized.

A note about color tags: The color tag will work on all font until a space is encountered. There needs to be a space after the tag, before the text to be colorized (although it's not actually required after r5840, it is recommended due to the way FSO wordwrapping works). There is a method to color spans of text, which is discussed in the Misc section below.

Example: '$b This is $b blue $b text' will show as 'This is blue text'

  • Bright White: $W
  • Standard (default) White: $w
  • Black: $k (Black)
  • Standard Blue: $b
  • Bright Blue: $B
  • Standard Green: $g
  • Bright Green: $G
  • Standard Yellow: $y
  • Bright Yellow: $Y
  • Gray: $e
  • Silver: $E
  • Violet Gray: $v
  • Violet: $V
  • Standard Red: $r
  • Bright Red: $R
  • Pink: $p
  • Bright Pink: $P
  • Orange: $o

Misc

  • The breaking tag $| can be used to stop a color before a character.
    • $g Standard Green = Standard Green.
    • $g Stand$|ard Green = Standard Green.
      • If the above causes wordwrapping oddness, you may want to write $g Stand$| ard Green (output is identical: Standard Green).
  • $quote will create double quotes.
    • Goober is $quotesilly$quote = Goober is "silly".
  • $semicolon will create a semicolon.
  • $callsign places the pilot name in its place.
  • $rank places the player's rank in its place.
  • $f, $h, & $n will color the text with the default colors for Friendly, Hostile and Neutral respectively. The colors are defined in the iff_defs.tbl.
  • Most special characters such as the comma ',', question mark '?', and exclamation point '!' cannot be colored as of 3.6.14.
  • To color spans of text use $c{ and $}.
    • The $y{ quick $g{ brown fox $r jumps over $} the lazy $} dog. = The quick brown fox jumps over the lazy dog.
    • This method will color special characters such as the comma ',', question mark '?', and exclamation point '!'
    • This method requires FSO build 8786 or later.
    • As of r10846, color spans work across linebreaks as well (either manually-added, or automatic from wordwrapping).

Styling text in SCPUI

SCPUI has its own HTML-based approach to styling text. It works everywhere that classic color tags do - briefings (including command, loop, and red alert briefings), debriefings, and the fiction viewer - but also the tech room, campaign descriptions, and nearly everywhere that long-form text is supported. For it to work in briefings, the text must be put in "HTML mode" by putting !html at the start, followed by a space. Everywhere else will work without that tag.

Text in HTML mode may contain HTML markup. Text may be styled using <span> tags with appropriate classes drawn from common.rcss; inline styles are also supported. FSO and HTML both make use of double quotes and slashes; to minimize conflicts, using single quotes and writing slashes as $slash is recommended. A complete example might look something like this: !html <span class='white'>Pilot attend!<$slashspan> Today, we'll be escorting the <span class='green italic'>GTC Examplar<$slashspan> as she raids <span class='red'>Shivan<$slashspan> positions throughout <span class='yellow'>Gamma Draconis<$slashspan>.

It is, however, rarely necessary to perform simple styling like this manually: SCPUI's Keywords.tbl may be used to automate common styling rules.