unity3d插件Daikon Forge GUI 中文教程6-高级控件richtextlabel的使用

3.5、richtextlabel文本

可以像Word文档一样编辑出多样的内容,图片,字体颜色大小下划线、超链接背景等等。

Defaults:

默认字体

默认图集

Blank Texture :空白的纹理

Appearance :

Font Size 默认字体大小

Line Height 行的高度,最小也不会小于默认字体大小(系统处理)。

TextStyle 默认文本的风格,加粗下划线斜体等。

keep whitespace 是否使用Text中文本的换行(Html的换行是:<br/>,如果选中,那么正常文本中的普通换行也算是换行)

Text Color 默认的文本颜色。

Alignment 文本的对其方式。

Layout :

Auto Height 是指自动调整上面Layout-》 Size-》 Height的大小。如果设置了那么下面的滚动条Scrolling选项就不能再用了。要根据实际的情况进行取舍。

Scrolling:

Allow Scroll是否允许滚动。

Scroll Pos x,y  设置水平,垂直滚动条的起始滚动值。

Add Momentum 作用还是未知,

水平滚动条对象。

垂直滚动条对象。

 

DF-gui呢使用了编写网页的标记性语言。 大家可以了解一下例子看看,下面是例子的一部分代码。

编辑上面的图片中的内容需要填写的文本的内容。如下:

Text:

<h1 color=yellowstyle="vertical-align: top; margin: 0;"><imgsrc="dfgui-icon" height=100 color=white> Using Rich TextMarkup</h1>

 

<h2color=cyan>Introduction</h2>

<p padding="5 10" style="text-align:justify; margin: 25px">

The DF-GUI Rich Text Control uses Unity'sdynamic fonts system to render TTF or OTF fonts

without requiring the use of a textureatlas. The dynamic font system builds a dynamic

texture atlas internally "ondemand", allowing you to use multiple font styles (like<b>bold</b> and

<i>italic</i>) as well as<font size="125%">different sizes</font> all in the sameline of text.

</p>

<p style="text-align: justify;margin: 25px">This also allows you to mix and match character sets inthe same label, like the following:

         <ul>

                   <li>Japanese:<span style="color: orange">日本語</span></li>

                   <li>Chinese:<span style="color: orange">汉语/漢語</span></li>

                   <li>Korean:<span style="color: orange">한국어/조선말</span></li>

                   <li>Hebrew:<span style="color: orange">עִבְרִית</span></li>

                   <li>Greek:<span style="color: orange">κρίνω</span></li>

                   <li>etc...</li>

         </ul>

</p>

<p style="text-align: justify;margin: 25px">

All text in this panel was rendered with asingle <b>dfRichTextLabel</b> control.

All font styles, colors, sizes, and effectswere specified through the use of an

HTML-like markup that has been specificallydesigned to be familiar to people

who have experience with HTML. Much like<a href="http://docs.unity3d.com/Documentation/Manual/StyledText.html"style="color: Green; font-style: bold">Unity&#39;s built-in&quot;rich text&quot; markup</a>,

the<strong>dfRichTextLabel</strong> control uses a subset of thespecified HTML tags to control

text formatting, but unlike Unity&#39;ssolution the tags that <strong>dfRichTextLabel

………………………………………….

<br/>

 

转载于:https://www.cnblogs.com/jiangshuai52511/p/5386498.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值