Skip to content

Image

extends Control

The Image class is used to display images on the UI interface.

You can obtain the Image component in the following ways:

Image alt

成员变量

Image.imageUV : Rect
The texture coordinates of the current image.
Image.fillCenter : boolean
Whether the image is filled in the center.
Image.material : Material|null
Material of the image.
Image.texture : Texture|null
The texture used for displaying the image.
Image.imageRegion : Rect
A rectangular region drawn from an image texture.
Image.maskable : boolean
(Read Only) Whether the image component has the Mask feature enabled.
Image.raycastTarget : boolean
Whether the current image component can respond to raycast detection.
Image.preserveAspect : boolean
Whether to maintain the aspect ratio of the image.
Image.fillClockwise : boolean
Whether the fill of the image component rotates clockwise.
Image.fillAmount : number
The proportion of the current image object that is filled.
Image.materialName : string
(Read Only) The name of the texture being displayed on the image.
Image.textureName : string
(Read Only) The name of the texture being displayed on the image.
Image.raycastPadding : Rect
The raycast extension fill value for the current image.
Image.fillMethod : FillMethod
The filling method for images.
Image.color : Color
The current color value of the image component.
Image.imageType : ImageType
Image Type.
Image.fillOrigin : FillOrigin
The starting point for filling an image.
Image.fillStartPoint : FillStartPoint
The position of the starting point for image filling.

成员方法

Image.GetTextureUUID ( ) : string
Set the atlas UUID for this image object.
Image.GetAtlasUUID ( ) : string
Get the atlas UUID of this image object.
Image.SetAtlasTexture ( atlasUUID : string , textureUUID : string ) : void
The UUID of the atlas for this image object.
Image.SetNativeSize ( ) : void
Sets the size of the image to the original size of the texture.