Unity3D说明文档翻译-Visual Components

Visual Components

可视化组件

With the introduction of the UI system, new Components have been added that will help you create GUI specific functionality. This section will cover the basics of the new Components that can be created.

UI系统介绍中,添加了新的组件,这将有助你创建GUI的特定功能.本章节将介绍可创建的新组件的基本知识.

Text

文本

The Text component, which is also known as a Label, has a Text area for entering the text that will be displayed. It is possible to set the font, font style, font size and whether or not the text has rich text capability.

文本组也被称为标签,有一个文本区域用于输入将被显示的文本.可以设置字体,字体风格,字体大小和是否有富文本性能.

There are options to set the alignment of the text, settings for horizontal and vertical overflow which control what happens if the text is larger than the width or height of the rectangle, and a Best Fit option that makes the text resize to fit the available space.

有选项来设置文本对齐方式,横向和纵向溢出设置控制如果文本大于矩形的宽或高时将发生什么,而最佳适配选项使文本调整大小来适应空用空间.

Image

图片

An Image has a Rect Transform component and an Image component. A sprite can be applied to the Image component under the Target Graphic field, and its colour can be set in the Color field. A material can also be applied to the Image component. The Image Type field defines how the applied sprite will appear, the options are:

一个图形对象有一个矩形转换组件和一个图形组件.一个精灵可应用到图形组件的图形字段上,且它的颜色可在颜色字段上设置.材质也可以应用到图形组件.图形类型字段定义如何应用精灵,这些选项是:

· 

Simple - Scales the whole sprite equally.

简单--整个精灵均等缩放

· 

Sliced - Utilises the 3x3 sprite division so that resizing does not distort corners and only the center part is stretched.

切割--使用3*3精灵分割因此调整大小不会使角变形并且仅拉伸中心部分.

· 

Tiled - Similar to Sliced, but tiles (repeats) the center part rather than stretching it. For sprites with no borders at all, the entire sprite is tiled.

平铺--类似切割,但平铺(重复)中心部分而不是拉伸它.如果精灵没定义边界则平铺帧张精灵.

· 

Filled - Shows the sprite in the same way as Simple does except that it fills in the sprite from an origin in a defined direction, method and amount.

填充--显示精灵方法和简单模式一样除了从一个原地以定义好的方向,方法和数量填充精灵.

· 

The option to Set Native Size, which is shown when Simple or Filled is selected, resets the image to the original sprite size.

设置本地大小选项是当选择简单或填充模式时,重置图片到精灵的原始大小.

Images can be imported as UI sprites by selecting Sprite( 2D / UI) from the ‘Texture Type’ settings. Sprites have extra import settings compared to the old GUI sprites, the biggest difference is the addition of the sprite editor. The sprite editor provides the option of 9-slicing the image, this splits the image into 9 areas so that if the sprite is resized the corners are not stretched or distorted.

图片可以通过贴图类型设置选择精灵(2D/UI)来作为UI精灵导入.精灵有额外导入设置,和老式GUI精灵相比,巨大的不同是添加了精灵编辑器.精灵编辑器提供了图片9切片方式,把图片分为9个区域因此如果精灵调整大小角将不会拉伸和变形.

Raw Image

原始图像

The Image component takes a sprite but Raw Image takes a texture (no borders etc). Raw Image should only be used if necessary otherwise Image will be suitable in the majority of cases.

图形组件带有一个精灵但原始图形带有一个贴图(没边界等).原始图形将只当需要时使用否则图形组件适合大部分情形.

Mask

遮罩

A Mask is not a visible UI control but rather a way to modify the appearance of a control’s child elements. The mask restricts (ie, “masks”) the child elements to the shape of the parent. So, if the child is larger than the parent then only the part of the child that fits within the parent will be visible.

一个遮罩不是一个可见UI控制更确切的说是一种修改控制的子元素的外观的方法.遮罩约束子元素相对于父对象的形状.因此,如果子对象大于父对象则仅只有适应在父对象上的子对象部分将可见.

Effects

效果

Visual components can also have various simple effects applied, such as a simple drop shadow or outline. See the Effects reference page for more information.

可视化组件也可以应用许多简单的效果,诸如一个简单的投影或轮廓.查看效果参考页面获取更多信息.

 

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值