Rich Text in Games. Small Continuation

I wrote an article about rich text in games before , briefly introduced some relevant knowledge of rich text, and also started a related GitHub project . Although the progress of this project is relatively slow, it is not stagnant. After nearly a period of continuous development Development, it has basically reached a usable state at present :)

Since the usage examples in the previous blog posts are outdated, I will post the sample code here (please refer to the repo for the latest code examples)

// init rich text
RichText.RichTextManager.Init(RichTextManager.Mode.UGUI);

// create rich text by rich syntax
var richSyntax = "this is a <u><url|value=www.google.com><style|value=yellow_24>Test RichText </u><image|name=smile|size=64,64></url><image|name=heart|size=64,64></url><style|value=default>~<br>";
m_richText.SetTextWidth(128);
m_richText.SetVerticalSpace(8);
m_richText.SetPivot(RichText.RichTextPivot.Center);
m_richText.SetSyntaxText(richSyntax);

give a screenshot

image

Interested friends can refer to it, welcome pr~

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325161719&siteId=291194637