How to format About.xml description

Started by UncleIROH, August 07, 2018, 01:51:05 AM

Previous topic - Next topic

UncleIROH

The description node in About.xml is loaded into a Unity label, and it supports Rich Text (https://docs.unity3d.com/Manual/StyledText.html)







TagExample
bWe are <b>not</b> amused.
iWe are <i>usually</i> not amused.
size We are <size=50>largely</size> unaffected.
color<color=#00ffffff>...</color>

However if you attempt to put any <tags> inside the <description> node, RimWorld will throw many errors. It is possible to encode the < into &lt; but it is difficult to maintain. But if we indicate the entire contents of <description> is character data using the <![CDATA[ ... ]]> wrapper we don't have to encode the <tags>.

Example:
<description><![CDATA[<size=30><color=#ffa500ff>Mod Name</color></size>
• Text about your awesome mod
• More text
• etc
]]>
</description>


Here is a complete About.xml file using this technique: https://github.com/cmdprompt/NanoRepairTech/blob/master/_rimworld/About/About.xml

RawCode


JohnnyMacaroni

Interesting I always wondered why I never managed to change the color of the description.
Thanks for sharing!

RawCode

almost everything in game affected by control codes, you can ever insert textures or icons into mod description or any of your texts if you want to.