Modding:Colors & Object Rendering: Difference between revisions

Jump to navigation Jump to search
 
(13 intermediate revisions by 5 users not shown)
Line 1: Line 1:
[[Category:Modding]]{{Modding Info}}
[[Category:Modding Resources]]{{Modding Info}}
= Overview =
= Overview =
Colors are defined in display.text.
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.
{{Color Table}}
{{Color Table}}
To get a palette file for these colors, refer to [[Visual_Style#Palette]].
In XML files, such as ObjectBlueprints.xml, the ampersand (&) must be replaced by the encoded ampersand (&amp;amp;)
In XML files, such as ObjectBlueprints.xml, the ampersand (&) must be replaced by the encoded ampersand (&amp;amp;)
{| class="wikitable tablesorter tablesorter-default stickyTableHeaders"
{| class="wikitable tablesorter tablesorter-default stickyTableHeaders"
Line 24: Line 26:
= Render Part =
= Render Part =
ColorString contains the foreground and (optionally) the background string for the ascii and tiles. Examples: <code>&B</code> or <code>&B^r</code>
ColorString contains the foreground and (optionally) the background string for the ascii and tiles. Examples: <code>&B</code> or <code>&B^r</code>
TileColor is identical to ColorString, but applies only to tiles. If this is not specified, a tile falls back to using the ColorString.


DetailColor changes the "third" color used only for tiles, not the ascii. DetailColor is always just a single character. Example: <code>g</code>  
DetailColor changes the "third" color used only for tiles, not the ascii. DetailColor is always just a single character. Example: <code>g</code>  
Line 29: Line 33:
So <code>ColorString="&M^g"</code> would be foreground bright magenta with a background color of green,
So <code>ColorString="&M^g"</code> would be foreground bright magenta with a background color of green,
{{qud char|&amp;M^g|Like this}}!
{{qud char|&amp;M^g|Like this}}!
TileColor overrides ColorString when tiles are being used.


If you want to color an item's display name, you enter color codes directly in the display name itself, for example the beaded bracelet:
If you want to color an item's display name, you enter color codes directly in the display name itself, for example the beaded bracelet:
Line 36: Line 39:
<part Name="Render" DisplayName="&amp;Cb&amp;Be&amp;ba&amp;cd&amp;Ce&amp;Bd&amp;y bracelet" ColorString="&amp;C"></part>
<part Name="Render" DisplayName="&amp;Cb&amp;Be&amp;ba&amp;cd&amp;Ce&amp;Bd&amp;y bracelet" ColorString="&amp;C"></part>
</syntaxhighlight>
</syntaxhighlight>
The [https://qud-colorgen.herokuapp.com/ qud-colorgen] utility (created by crayon) is an external tool that can help you create these complex color strings, however the newer Markup language the game uses might be good enough for your purposes.


Note that if a detail color is not specified, it will default to the background viridian color.
Note that if a detail color is not specified, it will default to the background viridian color.


== Additional Notes ==
== Color Markup Language ==
Most default text in the game is colored with the bright grey (&y) color, so you'll often see an <code>&y</code> at the end of strings to reset the color back to normal.
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><nowiki>{{color|text}}</nowiki></code>.  If you want to ensure colors "return" to what they were set to, you can leave out the color.  <code><nowiki>"{{|&RThis text is red}} and this will be whatever the color was before red"</nowiki></code>


For help formatting a string with colors, check out the super-useful [https://qud-colorgen.herokuapp.com/ qud-colorgen] utility (created by crayon).
In general, every string for rendering, except the color string/detail color on render part should use the new Markup language.


== 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. <nowiki>Insert non-formatted text here</nowiki>
<pre>
<pre>
{{color template|your text to color here}}
{{color template|your text to color here}}
Line 51: Line 54:
=== List of possible templates ===  
=== List of possible templates ===  
{{#invoke:ColorParse|shaderlist}}
{{#invoke:ColorParse|shaderlist}}
=== Anonymous Templates ===
=== Anonymous Templates ===
To create a temporary template, the format is: <pre>{{[color pattern delimited by -] [type]|[text]}}</pre>
To create a temporary template, the format is: <pre>{{[color pattern delimited by -] [type]|[text]}}</pre>
For example:<pre>{{R-R-R-R-R-M-M sequence|mumble mouth}}</pre>


The list of possible types are:
The list of possible types are:

Navigation menu