UGUI 学习笔记 3 Text 和 Rect Transform
来源:互联网 发布:汉诺塔问题递归算法 编辑:程序博客网 时间:2024/05/23 13:03
Text
1. 创建Text
添加Text 对象GameObject->UI->Text
添加Text 对象右键Object UI->Text
选中Object 给Object 添加Text component Component->UI-Text
选中Object 在Inspector中 Add Component->UI-Text
2. Text属性详解
Text :The text displayed by the control. Text 中显示的文本
Character:字
Font :The Font used to display the text. 文本中的字体样式
Font Style : The Style applied to the text. The options are Normal,Bold,Italic and Bold And Italic. 文本中的字体格式,有三种Bold 加粗,Italic 斜体,Bold And Italic 加粗和斜体
Line Spacing : The vertical separation between lines of text 行间距
Rich Text : Should markup elements in the text be interpreted as Rich Text styling? 设置文中中某些文字的特殊格式
Paragraph : 段落
Alignment : The horizontal and vertical alignment of the text. 水平方向和竖直方向的对齐方式。
Align by Geometry : Use the extents of glyph geometry to perform horizontal alignment rather than glyph metrics. 图文混排中对齐图片
Horizontal Overflow : The metod used to handle the situation where wrapped text is too tall to fit in the rectangle.The options are Truncate and Overflow. 水平方向shang 文字超出Text设置的宽时Truncate 不显示 Overflow 显示。
Vertical Overflow : The method use to handle the situation where wraped text is too tall to fit in the rectangle.The options are Truncate and Over flow. 竖直方向上的文字超出Text设置的高时Truncate不显示 Overflow显示。
Best Fit : Should Unity ignore the size properties and simply try to fit the text to the control’s rectangle? 显示Min Size 和 Max Size设置框。
自动设置字体最适合大小。大边框,Size= Max Size,小边框,Size=Min Size 。Text的大小小于Min Size就不显示了
Color : The color used to render the text 字体颜色
Material : The Material used to render the text. 用来渲染文本框的材质球。
Rect Transform
1. 控件属性详解
Pos(x,y,z) : Position of the rectangle’s pivot point relative to the anchors. 矩形的枢轴点相对于锚点的位置
Width/Height : Width and height of the rectangle 矩形的宽和高
Left,Top,Right,Bottom : Positions of the rectangle’s edges relative to their anchors.This can be thought of as padding inside the rectangle defined by the anchors. Shown in place of Pos and Width/Height when the anchors are separated(see below). 锚框,锚点不在一起时出现
Anchors The anchor points for the lower left corner and the upper right corner of the rectangle. 锚点,位置参考点。
Min : The anchor point for the lower left corner of the rectangle defined as fraction of the size of the parent rectangle.0,0 corresponds to anchoring to the lower left corner of the parent, thile 1,1 corresponds to anchoring to the upper right corner of the parent. 锚点最小值,左下角为(0,0)
右上角为(1,1)
Max :The anchor point for the upper right corner of the rectangle defined as a fraction of the size of the parent rectangle.0,0 corresponds to anchoring to the lower left corner of the parent,while 1,1 corresponds to anchoring to the upper right corner of the parent. 锚点最大值,左下角为(0,0)
右上角为(1,1)
Pivot : Location of the pivot point around which the rectangle rotates,defined as a fraction of the size of the rectangle itself. 0,0 corresponds to the lower left corner while 1,1 corresponds to the upper right corner. 枢轴点或者变换中心,时发生选在哪或发生比例变形的部分。
当变换中心被选择时,作为旋转和比例变换的中i性能。
设置修改器中心的默认位置。
定义所链接子物体的变换原点。
Rotation : Angle of rotation(in degrees) of the object around its pivot point along the X,Y and Z axis. 角度
Scale : Scale factor applied to the object in the X,Y and Z dimensions. 缩放
2. Anchor Presets 详解
Anchor 是子控件在父控件中的参考位置。当父控件的长宽和位置在变化时,Unity根据Anchor和Pivot调整子控件的位置。如果Anchor 不重合,子控件的长宽也会变化。
上面第一排参数名左起分别是 左 中 右 拉伸
左边第一列参数名上下分别是 上 中 下 拉伸
黄色的点代表Anchor 在父控件中的位置。
Anchor总共右16个位置可以设置,Anchor重合的有9种,Anchor不重合的有7种。
子控件四个角到对应Anchor的距离不改变。
按住Shift同时设置Pivot,按住 Alt 同时调整位置。
蓝色点代表Pivot
白色方框代表子控件位置。
- UGUI 学习笔记 3 Text 和 Rect Transform
- UGUI学习笔记2——Rect Transform
- (九)unity4.6学习Ugui中文文档-------参考-UGUI Rect Transform
- Unity3D UGUI中Rect Transform的特性
- U3D UGUI学习3 - Text
- Unity UGUI——Rect Transform组件(基础属性)
- Unity UGUI——Rect Transform组件(Anchors)
- Unity UGUI——Rect Transform组件(Anchor Presets)
- Rect Transform
- Rect Transform
- UGUI学习1-Text
- 3D transform (学习笔记)
- Android graphics学习笔记(2) - Rect和RectF
- UGUI 学习笔记 9 Scrollbar 和ScrollView
- UGUI学习(二):Scroll Rect 滚动区域
- UGUI学习笔记
- UGUI学习笔记
- UGUI 学习笔记
- 去水印--《On the Effectiveness of Visible Watermarks》
- Opencv3.0+vs2015
- redash添加elasticsearch数据源
- Bound Found(POJ-2566)(尺取法 and 前缀和)
- 《principles of model checking》中的离散时间马尔科夫链
- UGUI 学习笔记 3 Text 和 Rect Transform
- 数据结构知识点总结
- unity加载prefab的方式
- struct (指针题)不能正确输出hello
- c语言字符数组与字符串的使用详解
- 归并算法
- 用markdown语法AC的pat乙级1070
- PM2.5检测 -- PMS7003 采集和 MQTT 传输
- Square