Unity2017.1官方UGUI文档翻译——Raw Image

Raw Image

原生图片

The Raw Image control displays a non-interactive image to the user. This can be used for decoration, icons, etc, and the image can also be changed from a script to reflect changes in other controls. The control is similar to the Image control but does not have the same set of options for animating the image and accurately filing the control rectangle. However, the Raw Image can display any texture whilst the Image can only show a Sprite texture.

Raw Image控件向用户展示一个不可交互的图片。它可以被用作装饰品、图标等。而且Image可以用脚本更改Image以反映其他控件的更改。这个控件类似于Image控件但是没有提供更多的设置来让图片用不同的方式填充空间的矩形空间。然而,Raw Image可以用所有类型的texture,Image控件的texture却必须是Sprite

A Raw Image control

A Raw Image control

Properties

属性

Property:Function:
Texture The texture that represents the image to display.
Color The color to apply to the image.
Material The Material to use for rendering the image.
UV Rectangle The image’s offset and size within the control rectangle, given in normalized coordinates (range 0.0 to 1.0). The edges of the image are stretched to fill the space around the UV rectangle.
属性功能
Texture 表示要显示的图像的纹理
Color 要应用于图像的颜色
Material 用于渲染图片的Material
UV Rectangle

图像在控件矩形区域内的偏移和大小,以规范化坐标(范围为0.0到1.0)给出。 图像的边缘被拉伸以填充UV矩形周围的空间。

The image’s offset and size within the control rectangle, given in normalized coordinates (range 0.0 to 1.0). The edges of the image are stretched to fill the space around the UV rectangle.

 

Details

详细

Since the Raw Image does not require a sprite texture, you can use it to display any texture available to the Unity player. For example, you might show an image downloaded from a URL using the WWW class or a texture from an object in a game.

由于原始图像不需要精灵纹理,因此可以使用它来显示Unity可用的任何纹理。 例如,您可能会使用WWW类从URL下载的图像或来自游戏中物体的纹理。

The UV Rectangle properties allow you to display a small section of a larger image. The X and Y coordinates specify which part of the image is aligned with the bottom left corner of the control. For example, an X coordinate of 0.25 will cut off the leftmost quarter of the image. The W and H (ie, width and height) properties indicate the width and height of the section of image that will be scaled to fit the control rectangle. For example, a width and height of 0.5 will scale a quarter of the image area up to the control rectangle. By changing these properties, you can zoom and scale the image as desired (see also the Scrollbar control).

UV Rectangle属性允许你显示较大图像的一小部分。X和Y坐标指定图像的哪一部分与控件的左下角对齐。例如,0.25的X坐标将切断图像的最左边的四分之一。W和H(即,宽度和高度)属性表示将被缩放以适合控制矩形的图像部分的宽度和高度。例如,宽度和高度为0.5将按比例缩放四分之一图像区域填满控件矩形。 通过更改这些属性,可以根据需要缩放和缩放图像(另请参阅Scrollbar控件)。

posted @ 2017-12-19 20:34  破晓べ  阅读(665)  评论(0编辑  收藏  举报