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

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控件)。

时间: 2024-10-06 07:55:46

Unity2017.1官方UGUI文档翻译——Raw Image的相关文章

Unity2017.1官方UGUI文档翻译——Canvas

Canvas 画布 The Canvas is the area that all UI elements should be inside. The Canvas is a Game Object with a Canvas component on it, and all UI elements must be children of such a Canvas. Creating a new UI element, such as an Image using the menu GameO

Unity2017.1官方UGUI文档翻译——Interaction Components

Interaction Components 交互组件 This section covers components in the UI system that handles interaction, such as mouse or touch events and interaction using a keyboard or controller. The interaction components are not visible on their own, and must be c

Unity2017.1官方UGUI文档翻译——Animation Integration

Animation Integration 动画集成 Animation allows for each transition between control states to be fully animated using Unity’s animation system. This is the most powerful of the transition modes due the the number of properties that can be animated simult

Unity2017.1官方UGUI文档翻译——Rich Text

Rich Text 富文本 The text for UI elements and text meshes can incorporate multiple font styles and sizes. Rich text is supported both for the UI System and the legacy GUI system. The Text, GUIStyle, GUIText and TextMesh classes have a Rich Text setting

Unity2017.1官方UGUI文档翻译——Canvas Scaler

Canvas Scaler 画布缩放器 The Canvas Scaler component is used for controlling the overall scale and pixel density of UI elements in the Canvas. This scaling affects everything under the Canvas, including font sizes and image borders. “画布缩放器”组件用于控制画布中UI元素的整

Unity2017.1官方UGUI文档翻译——Text

Text 文本 The Text control displays a non-interactive piece of text to the user. This can be used to provide captions or labels for other GUI controls or to display instructions or other text. 文本控件向用户显示一个非交互式的文本片段. 它可以作为其他GUI控件提供标题或标签,或作为说明文本,或者其他用途. P

Unity2017.1官方UGUI文档翻译——Mask

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 t

Unity2017.1官方UGUI文档翻译——RectMask2D

RectMask2D 矩形2D遮罩 A RectMask2D is a masking control similar to the Mask control. The mask restricts the child elements to the rectangle of the parent element. Unlike the standard Mask control it has some limitations, but it also has a number of perfo

Unity2017.1官方UGUI文档翻译——Position as UV1

Position as UV1 This adds a simple Position as UV1 effect to text and image graphics. 把Canvas空间下的顶点坐标设置到UV1中,用于在Text和Image这样的图形组件中实现一些特效(特效要自定义shader实现) Properties 属性 原文地址:https://www.cnblogs.com/SolarWings/p/8182972.html