我如何将 html 格式的文本显示到统一的新 ui 文本?
前任。
<p>This is some <b><font size="3" color="red">Text</b></p>
你可以这样写
This is some <b><size=50><color=#ff0000ff>Text</color></size></b>
根据 Unity 文档,富文本格式中唯一受支持的标签如下:
<b> <i> <size> <color>
现在,作为一种让更高级的 html 标记统一工作的解决方法,您可能想尝试使用此处提供的 Html 纹理。想到的想法是,您将 html 格式的文本编写为普通的 .html 文件,然后将其渲染为纹理并在游戏中使用该纹理。可能工作不知道。:D
试试 TMText 富文本。
你可以做更多的样式,包括颜色:
<color="red">Red <color=#005500>Dark Green <#0000FF>Blue <color=#FF000088>Semitransparent Red
在此处了解更多信息:http: //digitalnativestudios.com/textmeshpro/docs/rich-text/