Modding:Colors & Object Rendering: Difference between revisions

From Caves of Qud Wiki
Jump to navigation Jump to search
imported>CaptainTechnicality54384
(Added in orange, cleaned up table source code to use color template)
(Fixed the xml and made some other minor updates.)
Line 83: Line 83:
| {{color | Y | █ }}
| {{color | Y | █ }}
|}
|}
 
In XML files, such as ObjectBlueprints.xml, the ampersand (&) must be replaced by the encoded ampersand (&)
{| class="wikitable tablesorter tablesorter-default stickyTableHeaders"
{| class="wikitable tablesorter tablesorter-default stickyTableHeaders"
!Prefix
!Prefix
Line 91: Line 91:
| colspan="1" |Foreground
| colspan="1" |Foreground
|&<nowiki><code></nowiki>
|&<nowiki><code></nowiki>
|<nowiki>&amp;<code></nowiki>
|&amp;amp;<nowiki><code></nowiki>
|-
|-
| colspan="1" |Background
| colspan="1" |Background
Line 99: Line 99:


= Render Part =
= Render Part =
ColorString contains the foreground and background string for the ascii and tiles.
ColorString contains the foreground and background string for the ascii and tiles. Example: <code>&B^r</code>


DetailColor changes the "third" color used only for tiles, not the ascii.
DetailColor changes the "third" color used only for tiles, not the ascii. DetailColor is always just a single character. Example: <code>g</code>


So ColorString="&M^g" would be foreground bright magenta with a background color of gree.
So <code>ColorString="&M^g"</code> would be foreground bright magenta with a background color of green.


TileColor overrides ColorString when tiles are being used.
TileColor overrides ColorString when tiles are being used.


Detail color takes just a single character.
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 the display name, you enter color codes directly in the display name itself, for example the beaded bracelet:


<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
<part Name="Render" DisplayName="&amp;amp;Cb&amp;amp;Be&amp;amp;ba&amp;amp;cd&amp;amp;Ce&amp;amp;Bd&amp;amp;y bracelet" ColorString="&amp;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>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.

Revision as of 14:24, 24 June 2019

Overview

Colors are defined in display.text.

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

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

Code Color
r dark red
R bright red
o dark orange
O bright orange
w brown
W yellow
g dark green
G bright green
b dark blue
B bright blue
c dark cyan
C bright cyan
m dark magenta
M bright magenta
k black
K dark grey
y bright grey
Y white

In XML files, such as ObjectBlueprints.xml, the ampersand (&) must be replaced by the encoded ampersand (&amp;)

Prefix Text Xml
Foreground &<code> &amp;<code>
Background ^<code> ^<code>

Render Part

ColorString contains the foreground and background string for the ascii and tiles. Example: &B^r

DetailColor changes the "third" color used only for tiles, not the ascii. DetailColor is always just a single character. Example: g

So ColorString="&M^g" would be foreground bright magenta with a background color of green.

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:

<part Name="Render" DisplayName="&amp;Cb&amp;Be&amp;ba&amp;cd&amp;Ce&amp;Bd&amp;y bracelet" ColorString="&amp;C"></part>

Most default text in the game is colored with the bright grey (&y) color, so you'll often see an &y at the end of strings to reset the color back to normal.