Skip to content
Image

UI / Image

Image Class

Image

Hierarchy

Table of contents

Properties

click

Properties

onCustomPropertyChange: Readonly<MulticastDelegate<(path: string, value: unknown, oldValue: unknown) => void>> other
Monitor custom attribute synchronization events

Accessors

imageColor(): Readonly<LinearColor> other
Get the color of image
imageDrawType(): Readonly<SlateBrushDrawType> other
Get image drawing type
imageGuid(): string other
Get image ID
imageInfo(): ImageInfo other
Image asset Information
imageSize(): Readonly<Vector2> other
Get image size
margin(): Readonly<Margin> other
Get image margins
click

Accessors

alignPosition(): Readonly<Vector2> other
Get the align position of the widget. When the align method is right align, bottom align, and center align, the value of alignPosition is different from that of position;
autoSizeHorizontalEnable(): boolean other
Get whether to automatically set the size horizontally
autoSizeVerticalEnable(): boolean other
Get whether to set the size automatically vertical
cachedGeometry(): Geometry other
Get the previous Get TickSpaceGeometry
constraints(): Readonly<UIConstraintAnchors> other
Get the layout of the control
desiredSize(): Vector2 other
Obtain expected size
enable(): boolean other
Is it available
guid(): string other
Get the widget GUID
isHovered(): boolean other
Is it hovered
mouseCursor(): MouseCursor other
Get the cursor type on the widget
name(): string other
Get Name
paintSpaceGeometry(): Geometry other
Get the last geometric information used to render the Widget
parent(): Widget other
Get parent node
pivot(): Vector2 other
Get the position of the widget anchor. This property determine the relative position of the widget graph and the anchor; At (0,0), the anchor point is located in the upper left corner of the control; (0.5,0.5), the anchor is at the center of the widget
position(): Readonly<Vector2> other
Get the position of the control
renderOpacity(): number other
Obtain rendering transparency
renderScale(): Vector2 other
Get rendering scaling
renderShear(): Vector2 other
Obtain rendering misalignment deformation
renderTransformAngle(): number other
Obtain the rendering angle
renderTransformPivot(): Vector2 other
Get Render anchor
size(): Vector2 other
Get size
tickSpaceGeometry(): Geometry other
Retrieve the last geometric information used to drive Widget Tick
transform(): Readonly<UITransform> other
Obtain the size and position of the control
visibility(): SlateVisibility other
Get visibility
visible(): boolean other
Is it visible
zOrder(): number other
Get Zorder

Methods

asyncExportBlendBrush(): Promise<string> other
Export the fused image as one
getImageAssetIconData(): Readonly<AssetIconData> other
Obtain ICON for displaying resources
setImageByBlendMode(backgroundPic: string, foregroundPic: string): void other
The two image are fused and superimposed to display on the image component
setImageByBlendModeWithGUID(GUID: string, foregroundPic: string): void other
The two image are fused and superimposed to display on the image component
setImageByFile(absPath: string, bRefreshCache?: boolean): void other
Set image style as local image file
setImageColorByHex(inHexString: string): void other
Set the color of the image.
setImageColorDecimal(R: number, G: number, B: number, A: number): void other
Set image Color
newObject(parent?: Canvas, inName?: string): Image other
Create Image widget
click

Methods

addChild(child: Widget): void other
Add child nodes
clone(position: Vector2, Parent?: any): Widget other
Clone the UI widget and its child nodes to the specified parent widget position (default to its parent node)
destroyObject(): void other
Remove and destroy immediately. Cannot be used again
equal(that: Widget): boolean other
Determine if it is the same object
findChildByPath(inPath: string): Widget other
Find nodes by relative path
getChildAt(index: number): Widget other
What is the position node to obtain
getChildByName<T: extends Widget<T>>(name: string): T: extends Widget<T> other
Search for nodes by name
getChildrenCount(): number other
Obtain the number of child nodes
getCustomProperties(): string[] other
Get all customize property
getCustomProperty<T: extends CustomPropertyType>(propertyName: string): T: extends CustomPropertyType other
Get customize property
getCustomPropertyChangeDelegate(property): Readonly<MulticastDelegate<(path: string, value: unknown, oldValue: unknown) => void>> other
Event proxy triggered when a given object property is modified
invalidateLayoutAndVolatility(): void other
Immediately trigger re rendering and layout calculation
removeAllChildren(): void other
Clearing all child nodes will destroy the UI and render it unusable
removeChild(child: Widget): void other
Removing a node will destroy the UI and make it unusable
removeChildAt(index: number): void other
Removing the third node will destroy the UI and render it unusable
removeObject(): void other
Immediately remove and add to the root node for reuse
serialize(): string other
Serialize UI widget
setCustomProperty(propertyName: string, value: undefined CustomPropertyType): void other
Set custom attributes
deserialize(Data: string, Parent?: Widget): Widget other
Deserialize UI

Properties

Accessors


imageColor

get imageColor(): Readonly<LinearColor> other

set imageColor(inColor): void other

Get the color of image

Returns

Readonly<LinearColor>The color of the image, TypeLinearColor type, data range 0~1

Set image Color

Parameters

inColor LinearColorUsage: Image color, TypeLinearColor type, data range 0~1

colour


imageDrawType

get imageDrawType(): Readonly<SlateBrushDrawType> other

set imageDrawType(inDrawType): void other

Get image drawing type

Returns

Readonly<SlateBrushDrawType>Image drawing type

Set image Drawing Type

Parameters

inDrawType SlateBrushDrawTypeUsage: drawing type

imageGuid

get imageGuid(): string other

set imageGuid(inGUID): void other

Get image ID

Returns

stringImage ID

Set image id

Parameters

inGUID stringUsage: new image style

imageInfo

get imageInfo(): ImageInfo other

Image asset Information

Returns

ImageInfo

imageSize

get imageSize(): Readonly<Vector2> other

set imageSize(inSize): void other

Get image size

Returns

Readonly<Vector2>Image size

Set image size

Parameters

inSize Vector2size

margin

get margin(): Readonly<Margin> other

set margin(inMargin): void other

Get image margins

Returns

Readonly<Margin>Image margin

Set margin of image

Parameters

inMargin MarginUsage: Image Margins

Methods


asyncExportBlendBrush

asyncExportBlendBrush(): Promise<string> other

Export the fused image as one

Returns

Promise<string>Local path of exported image

Precautions

It will take effect only after call setImageByBlendMode. Note for high consumption operations


getImageAssetIconData

getImageAssetIconData(): Readonly<AssetIconData> other

Obtain ICON for displaying resources

Returns

Readonly<AssetIconData>ICON information of resources

setImageByBlendMode

setImageByBlendMode(backgroundPic, foregroundPic): void other

The two image are fused and superimposed to display on the image component

Parameters

backgroundPic stringUsage: absolute path of background image range: path length
foregroundPic stringUsage: foreground image absolute path range: path length

setImageByBlendModeWithGUID

setImageByBlendModeWithGUID(GUID, foregroundPic): void other

The two image are fused and superimposed to display on the image component

Parameters

GUID stringUsage: Background image UID range: Depending on the length of the resource ID
foregroundPic stringUsage: foreground image absolute path range: path length

setImageByFile

setImageByFile(absPath, bRefreshCache?): void other

Set image style as local image file

Parameters

absPath stringImage absolute path range: path length
bRefreshCache? booleanIf default is true, the cache will be re created and refreshed. If it is false, the cache will be used
default: true

Precautions

  1. It is recommended to set bRefreshCache=false to improve performance 2 This API mainly cooperates with setImageByBlendMode and asyncExportBlendBrush to serve the mobile editor

setImageColorByHex

setImageColorByHex(inHexString): void other

Set the color of the image.

Parameters

inHexString stringHex Color string< Br>range: string type conforming to Hex characteristics

Specify the color of Hex text Set the color For example: # 05050505


setImageColorDecimal

setImageColorDecimal(R, G, B, A): void other

Set image Color

Parameters

R numberUsage: image R value< Range: [0, 255] type: integer
G numberUsage: G value of image< Range: [0, 255] type: integer
B numberUsage: image B value< Range: [0, 255] type: integer
A numberUsage: image transparency< Range: [0, 255] type: integer

newObject

Static newObject(parent?, inName?): Image other

Create Image widget

Parameters

parent? CanvasUsage: Create the external parent object of the control with default: null
inName? stringUsage: name of the create widget default: null range: set a reasonable name

Returns

ImageReturn the created object

When the parent and inName are the same as an existing object, the old object will be destroyed