Modding:Colors & Object Rendering: Difference between revisions

no edit summary
No edit summary
Line 3: Line 3:
Colors are defined in <code>Display.txt</code>.
Colors are defined in <code>Display.txt</code>.


Each color is defined by a single letter. &<nowiki><code> means to set the foreground color, ^<code> means to set the background color.</nowiki>
Each color is defined by a single letter. <code><nowiki>&</nowiki></code> means to set the foreground color, <code>^</code> means to set the background color.


Only the preset letter codes are allowed, adding new colors isn't totally trivial at the moment.
Only the preset letter codes are allowed, adding new colors isn't totally trivial at the moment.
Line 43: Line 43:


== Color Markup Language ==
== Color Markup Language ==
Most default text in the game is colored grey (&y), so you'll often see an <code>&y</code> at the end of strings to reset the color back to normal.  Because of this extremely confusing color bleed can happen when putting text strings together which use the simplified `&` and `^` color code schemes.  Because of this there is new system which parses text in double curly braces: <code>{{color|text}}</code>.  If you want to ensure colors "return" to what they were set to, you can leave out the color.  <code>"{{|&RThis text is red}} and this will be whatever the color was before red"</code>
Most default text in the game is colored grey (&y), so you'll often see an <code>&y</code> at the end of strings to reset the color back to normal.  When putting strings using the basic color codes together to make sentences extremely confusing color bleed becomes possible.  Because of this there is new system which parses text in double curly braces: <code>{{color|text}}</code>.  If you want to ensure colors "return" to what they were set to, you can leave out the color.  <code>"{{|&RThis text is red}} and this will be whatever the color was before red"</code>


== 2.0.200.0+ Modding ==
Text can also be colored as follows using any of the color templates defined in StreamingAssets\Base\Colors.xml.
Text can also be colored as follows using any of the color templates defined in StreamingAssets\Base\Colors.xml.
<pre>
<pre>