您的位置:首页 > 移动开发 > Unity3D

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

2014-08-29 12:05 501 查看
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's built-in"rich text" markup</a>,

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

text formatting, but unlike Unity'ssolution the tags that <strong>dfRichTextLabel

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

<br/>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐