본문 바로가기
개발/Unity

Unity) TextMeshPro Rich Text Tag 정리(Color, Size, Mark, Sprite...etc : 문자 효과)

by 테샤르 2023. 7. 22.

TextMeshPro Text -Tag 정리(Color, Size, Mark, Sprite...etc)

 

Tag로 여러가지 효과를 표현할수 있다. 그중에서 가장 많이 사용하는 Text Tag를 간단히 정리한다.

 

반응형

 

< Text Alignment >

<align="right">Right
<align="center">Center
<align="left">Left

 

< Bold and Italic >


The <i>quick brown fox</i> jumps over the <b>lazy doy</b>

 

< Color >



<color="red">Red <color=#005500>Dark Green <#0000FF>Blue <color=#FF000088>Semitransparent Red

 

< Size >


<size=100%>Echo <size=80%>Echo <size=60%>Echo <size=40%>Echo <size=20%>Echo

 

< Font >

Would you like <font="Impact SDF">a different font?</font> or just <font="NotoSans" material="NotoSans Outline">a different material?

 

< Spacing >


<cspace=1em>Spacing</cspace> is just as important as <cspace=-0.5em>timing.

 

< No parse >

Use <noparse><b></noparse> for <b>bold</b> text.

 

<Line Height>

Line height at 100%
<line-height=50%>Line height at 50%
<line-height=100%>Rather cozy.
<line-height=150%>Line height at 150%
Such distance!


< Margin >


Our margins used to be very wide.
<margin=5em>But those days are long gone.

 

< Mark >


Text <mark=#ffff00aa>can be marked with</mark> an overlay.

 

< Sprite >

Sprites! <sprite=0> More sprites! <sprite index=3> And even more! <sprite name="Default Sprite Asset_4" color=#55FF55FF>

 

<Font Tag 를 사용할때 적용이 안되는 경우>

TMP Setting의 Default Font Asset의 Path 경로를 확인한다.

해당 경로에 포함되어야 <font="폰트이름"> </font>가 가능하다

 

< Mark Tag 를 사용했을때 Color Overlay 되는 상황 해결 방법>

 

 

1번 : TMP 2개를 사용해서 하나는 mark Tag 하나는 없는 형태로 작업 : [링크]

 

How highlight text with spacing in Unity without TMP #mark tag

How do I highlight text with spacing in Unity like in this picture I've used a TMP mark tag, but it doesn't work the way I would expect it to, it ends up drawing on top of the text instead of behi...

stackoverflow.com

2 번 : Font Tag를 사용해서 렌더링을 맨위로 처리되도록 처리 : [링크]

 

<font="LiberationSans SDF"><mark=#16f0b680> TEST</font></font> TEST

 

 

 

 

TextMeshPro - Rich Text Tag - Supported Tag : [링크]

 

Supported Rich Text Tags | TextMeshPro | 4.0.0-pre.2

Supported Rich Text Tags The following table is a quick reference of supported rich text tags. For details, see the main pages for specific tags. Tag: Description: Notes: Changes the text's horizontal alignment. Converts text to uppercase before rendering.

docs.unity3d.com

 

TextMeshPro Documentation : [링크]

 

Rich Text, TextMesh Pro Documentation

You can use rich text tags to alter the appearance and layout of your text. These tags work like HTML or XML tags, but have less strict syntax. A tag looks like . Many tags operate on a scope, which you can end with . Such scopes can be nested, and you don

digitalnativestudios.com

 

★★★★☆

반응형

댓글