NGUI之UILabel
重要属性说明
overflow:
Shrink Content: 意味着内容会自动被缩小以便适应区域。它在你使用动态字体的同时使用Keep Crisp设置时有效,让字体变小,而不是缩放内容。
Clamp Content:简单意味着如果文本没有适应,就直接截断。
Resize Freely:选项让label的大小通过文本来控制。你不能自己修改大小。
Resize Height:将在必要的时候增加label的高度,但会保持宽度是常量。
spacing: 可以让你调整字符间的距离。正负数都可以,单位是像素。
Max Line: 可以让你控制你最大想要多少行。0的话是不限制。
BBCode语法(需勾选BBCode)
You can use BBCode to make words [b]bold[/b], [i]italic[/i], [u]underline[/u], [s]strikethrough[/s],
[sub]sub[/sub] or [sup]sup[/sup] script, and even embed hidden content and [url=http://www.tasharen.com/][u]clickable hyperlinks[/u][/url]. Go ahead, click it!
Search the [99ff00]Project View[-] for "Control", then drag & drop the prefab you want directly into the [99ff00]Scene View[-]. :)
Emoticons? Sure, why not:
:) :D <_< >_< x_x -_- o.o
(A) (B) (X) (Y)
将UILabel Attach BoxCollider, IsTrigger=true
OpenURLOnClick.cs如下
public class OpenURLOnClick : MonoBehaviour
{
void OnClick ()
{
UILabel lbl = GetComponent<UILabel>(); if (lbl != null)
{
string url = lbl.GetUrlAtPosition(UICamera.lastWorldPosition);
if (!string.IsNullOrEmpty(url)) Application.OpenURL(url);
}
}
}
NGUI之UILabel的更多相关文章
- 【Unity3D】【NGUI】UILabel
原文:http://www.tasharen.com/forum/index.php?topic=6706.0 NGUI讨论群:333417608 概述 UILabel是用来显示文本的脚本,继承自UI ...
- NGUI中UILabel使用url标签的一个bug
在NGUI里,UILabel控件可以支持一些简单功能的标签,使文本显示更丰富及实现类似超链接的功能.但是在使用的时候发现了NGUI3.5.9版本里存在着一个bug.不过还好修复这个bug也很简单. 在 ...
- 代码动态改变 NGUI UILabel 的字体
有一次因为 ttf 分成简体和繁体两个..所以就需要动态改变NGUI 中 UILabel 的字体,但是不知道 UILabel 保存字体的字段是哪个 网上搜到..在这里记录一下 using UnityE ...
- NGUI3.5系列教程之 UILabel
此NGUI版本为:3.5.1 NGUI 的UILabel脚本下的文字框可以用BBCode设置:[b]Bold[/b] 粗体 [i]italic[/i] 斜体 [u]underline[/u]下划线 [ ...
- NGUI的字体加粗效果
ngui的UILabel可以通过属性面板(inspector)设置字体的样式:加粗 倾斜 正常等. 但是如果通过这里设置了加粗,与实际的加粗不一样,ngui有一个拉伸宽度的变化. 这让人觉得很丑 .如 ...
- [Unity]制作游戏中名字板的过程记录
先大概说一下需求: 1 每个模型上都要有名字板:人.怪.npc等等. 2 名字板上会显示:名字(文字).血条(图片)等 3 因为是透视相机,名字板离得太近会变得超大,且主角移动,名字板的位置相对于相机 ...
- NGUI学习笔记(一)UILabel介绍
来个前言: 作为一个U3D程序员,自然要写一写U3D相关的内容了.想来想去还是从UI开始搞起,可能这也是最直观同时也最重要的部分之一了.U3D自带的UI系统,也许略坑,也没有太多介绍的价值,那么从今天 ...
- NGUI UILabel文字宽度和 UITweener
做个记录 方便别人和自己以后查找. NGUI UILabel 文字宽度 高度 mLabel.GetComponent<UILabel>().getLabWidth() mLabel ...
- Unity NGUI UILabel文字变色 及相关问题
在同一个UILabel中可以有不同颜色的文字只需要添加BBCode标记[ff0000]Red Label[-],那么在这个标记之间的RedLabel 就会变成红色 注意: 1.文本最终显示的颜色=Co ...
随机推荐
- python leetcode 日记--Maximal Square--221
题目: Given a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and ...
- python leetcode 日记 --Contains Duplicate --217
题目 Given an array of integers, find if the array contains any duplicates. Your function should retur ...
- Sql获取第一天、最后一天
昨天面试一家公司,上机题目中要求获取每月最后一笔订单.用到了日期的选择性查询,回来在ITeye上找到了这篇文章. 原文: http://new-fighter.iteye.com/blog/17587 ...
- Android 计算器UI-TableLayout
表格布局(TableLayout) <?xml version="1.0" encoding="utf-8"?> <TableLayout x ...
- Windows和Unix下的编码问题
今天测试shell脚本时,执行报错: ./report.sh: /tmp/tmp.E8ekx6r5Qq/report.sh: /bin/bash^M: bad interpreter: No such ...
- 《JavaScript模式》第5章 对象创建模式
@by Ruth92(转载请注明出处) 第5章:对象创建模式 JavaScript 是一种简洁明了的语言,并没有其他语言中经常使用的一些特殊语法特征,如 命名空间.模块.包.私有属性 以及 静态成员 ...
- Kafka实战系列--Kafka的安装/配置
*) 安装和测试 cd /path/to/server#) 下载kafka二进制包wget http://apache.fayea.com/apache-mirror/kafka/0.8.1.1/ka ...
- Inversion of Control Containers and the Dependency Injection pattern(转)
In the Java community there's been a rush of lightweight containers that help to assemble components ...
- mac 下更新 .bash_profile 文件
1.打开terminal(终端) 2.cd ~ ( 进入当前用户的home目录) 3.open .bash_profile (打开.bash_profile文件,如果文件不存在就 创建文件:touc ...
- maven的SNAPSHOT版本和正式版本不同
转载文章: http://www.huangbowen.net/blog/2016/01/29/understand-official-version-and-snapshot-version-in- ...