Unity_UGUI翻译(3)Visual Components

Visual Components(可视化组件)

There are new components and gameObjects that have been added with UI that allow for ease of creation and GUI specific functionality. This section will cover the basics of the new gameObjects 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.

Text组件有一个文本输入区域,这里输入的文字可以被显示出来,它经常被作为标签使用.Text组件也可以设置字体,字体大小,或者是否选上Rich Text选项

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.

也可以设置文本的对齐方式,通过设置水平方向和垂直方向的对齐方式,可以控制当文本长度超过矩形框宽度和长度的时候,如何显示.Best Fit选项可以使得文本自动根据长度改变文字大小来适应Text组件空间.

Image

A Toggle 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:

Toggle(Image?)有Rect Transform组件和一个Image组件,精灵图片可以放置到Image组建的目标图像输入框(Source Image)中,同时也可以在色彩栏中选择要设置的颜色,一个材质球同样也可以放置到Image组件中,Image种类选择栏提供了几种不同的精灵图片显示方式,这些选项如下:

  • 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.
  • Sliced-把精灵图片分割成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.
  • Tiled-和Sliced方式很像,只不过中间的部分采取的方式不是改变大小,而是不断重复.对于没有边框的精灵突变,整个图片就是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.
  • Filed-和Simple采取同样的方式显示精灵图片,除了它可以定义图片开始显示时候的方向,方法,数量.

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

当使用Simple和Filled方式时,Set Native 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.

可以在图片的Texture Type将它设为Sprite(2D/UI),这样这个图片就可以被导入为UI精灵.这比之前老的GUI精灵有更多的导入设置,最大的不同是,新添加了一个精灵编辑器,他有一个九宫格选项,可以设置如果划分图片的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.

Image组件需要一个精灵图片,但是原始图片需要的是一个纹理材质(texture),不过这样的纹理应该是无边框的.使用Raw Image是有必要,除非为图像会在大多数情况下适用

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.

Mask不是一个可见的UI控制器,而是用来控制UI子对象的大小显示.mask限制了子物体的大小只能限制在父物体里面,如果子物体比父物体大,那么只有在父物体中的那部分可以看到.

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.

Effects reference pages中会详细介绍

时间: 2024-11-12 15:08:05

Unity_UGUI翻译(3)Visual Components的相关文章

(四)unity4.6Ugui中文教程文档-------概要-UGUI Visual Components

大家好.我是孙广东. 转载请注明出处:http://write.blog.csdn.net/postedit/38922399 更全的内容请看我的游戏蛮牛地址:http://www.unitymanual.com/forum.php?mod=guide&view=my 3.Visual Components 有新的组件和游戏对象已加入到uGUI.同意和easy的创建GUI特定功能. 这一节将介绍新的游戏物体被创建的基础. 3.1 Text 该Text 组件.也被称为是一个标签.有一个Text 区

【转】(四)unity4.6Ugui中文教程文档-------概要-UGUI Visual Components

原创至上,移步请戳:(四)unity4.6Ugui中文教程文档-------概要-UGUI Visual Components 3.Visual Components 有新的组件和游戏对象已添加到uGUI,允许和容易的创建GUI特定功能.这一节将介绍新的游戏物体被创建的基础. 3.1 Text 该Text 组件,也被称为是一个标签,有一个Text 区域用于输入将显示的文本.它是可以设置的字体.字体样式.字体大小和是否使用RichText的能力. 文本的对齐方式alignment和自动换行Wrap

(十一年)unity4.6得知Ugui中国文献-------参考-UGUI Visual Components

 大家好,我是太阳广东. 转载请注明出处:http://write.blog.csdn.net/postedit/38922399 更全的内容请看我的游戏蛮牛地址:http://www.unitymanual.com/forum.php?mod=guide&view=my 3.Visual Components 可视化组件同意非常easy的创造GUI特定功能. ?Text ?Image ?Raw Image ?Mask 3.1 Text 文本控件向用户显示一块非交互式的文本. 这能够用于为其

Unity_UGUI翻译(2) Basic Layout(基本布局)

Basic Layout(基本布局) In this section we’ll look at how you can position UI elements relative to the Canvas and each other. If you want to test yourself while reading, you can create an Image using the menu GameObject > UI > Image. 在这一节中,我们将会尝试如何摆放UI元素

和Keyle一起学StrangeIoc – Extensions

Strange: the IoC framework for Unity Extensions You may have heard that Strange is a Dependency Injection framework. I'm a little uncomfortable with that description. Sure, Strange offers DI and it's a great use, but the core of the framework - as I'

Android学习路线(十三)Activity生命周期——停止和恢复(Pausing and Resuming )一个Activity

先占个位置,下次翻译~ :p During normal app use, the foreground activity is sometimes obstructed by other visual components that cause the activity to pause. For example, when a semi-transparent activity opens (such as one in the style of a dialog), the previou

Android官方入门文档[13]暂停和恢复一个Activity活动

Android官方入门文档[13]暂停和恢复一个Activity活动 Pausing and Resuming an Activity暂停和恢复一个Activity活动 This lesson teaches you to1.Pause Your Activity2.Resume Your Activity You should also read?Activities 这节课教你1.暂停您的Activity活动2.恢复您的Activity活动 你也应该阅读?Activity活动 Try it

README of WinSCP.

This is the README file for source code package of WinSCP. To build WinSCP you need: - Embarcadero C++ Builder XE6 Professional. http://www.embarcadero.com/products/cbuilder - Microsoft .NET Framework 3.5 (for MSBuild) http://www.microsoft.com/netfra

How to detect and avoid memory and resources leaks in .NET applications

Despite what a lot of people believe, it's easy to introduce memory and resources leaks in .NET applications. The Garbage Collector, or GC for close friends, is not a magician who would completely relieve you from taking care of your memory and resou