Skip to content
MaskButton

UI / MaskButton

MaskButton Class ​

Mask button

Hierarchy ​

Table of contents ​

Properties ​

click

Properties ​

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

Accessors ​

circleCenter(): Vector2 other
Obtain the center rotation point of the circular mask
circleValue(): number other
Obtain the occlusion percentage of a circular mask
clickMethod(): ButtonClickMethod other
Get click mode
clickedDelegate(): MulticastDelegate<() => void> other
Click Event
disableImageColor(): Readonly<LinearColor> other
Get disable image Color
disableImageDrawType(): Readonly<SlateBrushDrawType> other
Get disable image Drawing Type
disableImageGuid(): string other
Get disabled image ID
disableImageMargin(): Readonly<Margin> other
Get disable image Margins
disableImageSize(): Readonly<Vector2> other
Get disable image Size
enableTransition(inBoolean: boolean): void other
Should different pressing schemes be applied
fanShapedRotated(): number other
Get the rotation of the circular sector mask
fanShapedRotatedCenter(): Vector2 other
Get the center rotation point of the circular sector mask
fanShapedValue(): number other
Obtain the mask progress of the fan-shaped mask
focusable(): boolean other
Get whether to obtain input focus
hoveredDelegate(): MulticastDelegate<() => void> other
Suspension event
inverseOpacity(): boolean other
Obtain the weight of reverse transparency
isTransitionEnable(): boolean other
Is the button enabled in transition mode, and is pressing it effective
maskImageColor(): Readonly<LinearColor> other
Get mask image color
maskImageGuid(): string other
Get the ID of the mask image setting
maskOpacity(): number other
Obtain the transparency of the base map at the occlusion location
maskTextureOpacity(): number other
Obtain the transparency of the occlusion map at the occlusion location
maskType(): MaskButtonType other
Get Mask cull Type
normalImageColor(): Readonly<LinearColor> other
Get normal image colors
normalImageDrawType(): Readonly<SlateBrushDrawType> other
Obtain ordinary image drawing types
normalImageGuid(): string other
Obtain a regular image ID
normalImageMargin(): Readonly<Margin> other
Get normal image margins
normalImageSize(): Readonly<Vector2> other
Get image size
pressedDelegate(): MulticastDelegate<() => void> other
Press Event
pressedImageColor(): Readonly<LinearColor> other
Get the color of pressed image
pressedImageDrawType(): Readonly<SlateBrushDrawType> other
Obtain the type of pressed image drawing
pressedImageGuid(): string other
Get press image ID
pressedImageMargin(): Readonly<Margin> other
Get press image margins
pressedImageSize(): Readonly<Vector2> other
Get the size of pressing image
pressedMethod(): ButtonPressMethod other
Acquire press mode
releasedDelegate(): MulticastDelegate<() => void> other
Release event
roundBoxPercentOffset(): Vector2 other
Obtain the percentage size margin offset of the rectangle
roundBoxRadius(): number
Get the set corner radius
roundBoxSharpness(): number
Get the set fillet sharpening degree
roundBoxUVRatio(): number
Obtain rounded corner adjustment size
touchMethod(): ButtonTouchMethod other
Get touch mode
unHoveredDelegate(): MulticastDelegate<() => void> other
Unsettled event
useMaskTextureOpacity(): boolean other
Get whether the mask outline is cull
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 ​

addKey(key: Keys): void other
The same button can only control one UI control at a time, and the latest bound UI control will overwrite the previous binding; The binding added in the script cannot override the UI controls bound to the same key in the editor's key binding menu. However, when two UI controls are bound to the same key separately through code and menu, the priority of using code binding is higher
getKeys(): Keys[] other
Get all the keyboard keys bound to the current UI widget, including the editor key binding menu and the code bound keys
isPressed(): boolean other
Whether press
removeKey(key: Keys): void other
This operation only unbinds dynamically bound keys and cannot unbind keys bound in the editor's key binding menu
setDisableImageColorByHex(inHexString: string): void other
Set unavailable color to specify Hex's color text, set color # 05050505
setDisableImageColorDecimal(R: number, G: number, B: number, A: number): void other
Set disable Color
setMaskImageColorByHex(inHexString: string): void other
Set the mask image color Specify the color of Hex text Set Color # 05050505
setMaskImageColorDecimal(R: number, G: number, B: number, A: number): void other
Set mask image color
setNormalImageColorByHex(inHexString: string): void other
Set the color of the regular image and specify the color of Hex. Text setting color # 05050505
setNormalImageColorDecimal(R: number, G: number, B: number, A: number): void other
Set regular image colors
setPressedImageColorByHex(inHexString: string): void other
Set Press image Color Specify the color of Hex text Set Color # 05050505
setPressedImageColorDecimal(R: number, G: number, B: number, A: number): void other
Set the color of the pressed image
newObject(parent?: Canvas, inName?: string): MaskButton other
Create Mask 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 ​


circleCenter ​

• get circleCenter(): Vector2 other

• set circleCenter(center): void other

Obtain the center rotation point of the circular mask

Returns ​

Vector2Central percentage point

Set the center rotation point of the circular mask

Parameters ​

center Vector2Usage: percentage of center point

circleValue ​

• get circleValue(): number other

• set circleValue(value): void other

Obtain the occlusion percentage of a circular mask

Returns ​

numberProgress value, 0~1

Set the occlusion percentage of the circle mask

Parameters ​

value numberUsage: Percentage progress value, 0~1

clickMethod ​

• get clickMethod(): ButtonClickMethod other

• set clickMethod(inClickMethod): void other

Get click mode

Returns ​

ButtonClickMethodClick mode

Set click mode

Parameters ​

inClickMethod ButtonClickMethodUsage: Click on mode selection

clickedDelegate ​

• get clickedDelegate(): MulticastDelegate<() => void> other

Click Event

Returns ​

MulticastDelegate<() => void>Return the proxy of the event

disableImageColor ​

• get disableImageColor(): Readonly<LinearColor> other

• set disableImageColor(inColor): void other

Get disable image Color

Returns ​

Readonly<LinearColor>Disable image color, Type.LinearColor type, data range 0~1

Set disable image Color

Parameters ​

inColor LinearColorUsage: Color, TypeLinearColor type, data range 0~1

disableImageDrawType ​

• get disableImageDrawType(): Readonly<SlateBrushDrawType> other

• set disableImageDrawType(inDrawType): void other

Get disable image Drawing Type

Returns ​

Readonly<SlateBrushDrawType>Disable image Draw Type

Set to disable image drawing types

Parameters ​

inDrawTypeSlateBrushDrawType

Disable image Draw Type


disableImageGuid ​

• get disableImageGuid(): string other

• set disableImageGuid(inGuid): void other

Get disabled image ID

Returns ​

stringDisable Image ID

Set unavailable image ID

Parameters ​

inGuid stringUsage: image id

disableImageMargin ​

• get disableImageMargin(): Readonly<Margin> other

• set disableImageMargin(inMargin): void other

Get disable image Margins

Returns ​

Readonly<Margin>Disable image Margins

Set disable image Margins

Parameters ​

inMargin MarginUsage: disable image margins

disableImageSize ​

• get disableImageSize(): Readonly<Vector2> other

• set disableImageSize(inSize): void other

Get disable image Size

Returns ​

Readonly<Vector2>Disable image size

Set disable image size

Parameters ​

inSize Vector2Usage: Size

enableTransition ​

• set enableTransition(inBoolean): void other

Should different pressing schemes be applied

Parameters ​

inBoolean booleanUsage: Whether to apply a different press scheme

fanShapedRotated ​

• get fanShapedRotated(): number other

• set fanShapedRotated(value): void other

Get the rotation of the circular sector mask

Returns ​

numberRotation angle 0~1

Set the rotation of the circular sector mask

Parameters ​

value numberUsage: Rotation angle 0~1

fanShapedRotatedCenter ​

• get fanShapedRotatedCenter(): Vector2 other

• set fanShapedRotatedCenter(center): void other

Get the center rotation point of the circular sector mask

Returns ​

Vector2Rotation center percentage point

Set the center rotation point of the circular sector mask

Parameters ​

center Vector2Usage: percentage of center point

fanShapedValue ​

• get fanShapedValue(): number other

• set fanShapedValue(value): void other

Obtain the mask progress of the fan-shaped mask

Returns ​

numberProgress value

Set the mask progress of the circular sector mask

Parameters ​

value numberUsage: percentage progress value

focusable ​

• get focusable(): boolean other

• set focusable(inFocus): void other

Get whether to obtain input focus

Returns ​

booleanWhether to obtain input focus

Set whether to obtain input focus

Parameters ​

inFocus booleanUsage: Get input focus or not

hoveredDelegate ​

• get hoveredDelegate(): MulticastDelegate<() => void> other

Suspension event

Returns ​

MulticastDelegate<() => void>Return the proxy of the event

inverseOpacity ​

• get inverseOpacity(): boolean other

• set inverseOpacity(inverseOpacityWeight): void other

Obtain the weight of reverse transparency

Returns ​

booleanweight

Reverse transparency weight

Parameters ​

inverseOpacityWeight booleanweight

isTransitionEnable ​

• get isTransitionEnable(): boolean other

Is the button enabled in transition mode, and is pressing it effective

Returns ​

booleanWhether the button enable the transition mode

maskImageColor ​

• get maskImageColor(): Readonly<LinearColor> other

• set maskImageColor(inColor): void other

Get mask image color

Returns ​

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

Set mask image color

Parameters ​

inColor Readonly<LinearColor>Usage: Color, TypeLinearColor type, data range 0~1

maskImageGuid ​

• get maskImageGuid(): string other

• set maskImageGuid(InGuid): void other

Get the ID of the mask image setting

Returns ​

stringMask image ID

Set mask image ID

Parameters ​

InGuidstring

maskOpacity ​

• get maskOpacity(): number other

• set maskOpacity(o): void other

Obtain the transparency of the base map at the occlusion location

Returns ​

numbertransparency

Set the transparency of the base map at the occlusion location

Parameters ​

o numbertransparency

maskTextureOpacity ​

• get maskTextureOpacity(): number other

• set maskTextureOpacity(o): void other

Obtain the transparency of the occlusion map at the occlusion location

Returns ​

numbertransparency

Set the transparency of the occlusion map at the occlusion location

Parameters ​

o numbertransparency

maskType ​

• get maskType(): MaskButtonType other

• set maskType(inType): void other

Get Mask cull Type

Returns ​

MaskButtonTypeCull Type

Set Mask cull Type

Parameters ​

inType MaskButtonTypeCull Type

normalImageColor ​

• get normalImageColor(): Readonly<LinearColor> other

• set normalImageColor(inNormalColor): void other

Get normal image colors

Returns ​

Readonly<LinearColor>Normal image color, Type.LinearColor type, data range 0~1

Set regular image colors

Parameters ​

inNormalColor LinearColorUsage: Color, TypeLinearColor type, data range 0~1

normalImageDrawType ​

• get normalImageDrawType(): Readonly<SlateBrushDrawType> other

• set normalImageDrawType(inDrawType): void other

Obtain ordinary image drawing types

Returns ​

Readonly<SlateBrushDrawType>Ordinary image drawing type

Set normal image drawing type

Parameters ​

inDrawType SlateBrushDrawTypeUsage: Type

normalImageGuid ​

• get normalImageGuid(): string other

• set normalImageGuid(inGuid): void other

Obtain a regular image ID

Returns ​

stringNormal image ID

Set normal image ID

Parameters ​

inGuid stringUsage: image id

normalImageMargin ​

• get normalImageMargin(): Readonly<Margin> other

• set normalImageMargin(inMargin): void other

Get normal image margins

Returns ​

Readonly<Margin>Normal image margin

Set normal image margins

Parameters ​

inMargin MarginUsage: Normal image margins

normalImageSize ​

• get normalImageSize(): Readonly<Vector2> other

• set normalImageSize(inSize): void other

Get image size

Returns ​

Readonly<Vector2>Normal image size

Set image size

Parameters ​

inSize Vector2Usage: Size

pressedDelegate ​

• get pressedDelegate(): MulticastDelegate<() => void> other

Press Event

Returns ​

MulticastDelegate<() => void>Return the proxy of the event

pressedImageColor ​

• get pressedImageColor(): Readonly<LinearColor> other

• set pressedImageColor(inColor): void other

Get the color of pressed image

Returns ​

Readonly<LinearColor>Press image color, Type.LinearColor type, data range 0~1

Set the color of the pressed image

Parameters ​

inColor LinearColorUsage: Color, TypeLinearColor type, data range 0~1

pressedImageDrawType ​

• get pressedImageDrawType(): Readonly<SlateBrushDrawType> other

• set pressedImageDrawType(inDrawType): void other

Obtain the type of pressed image drawing

Returns ​

Readonly<SlateBrushDrawType>Press image drawing type

Set press image drawing type

Parameters ​

inDrawType SlateBrushDrawTypeUsage: Type

pressedImageGuid ​

• get pressedImageGuid(): string other

• set pressedImageGuid(inGuid): void other

Get press image ID

Returns ​

stringPress image ID

Set press image ID

Parameters ​

inGuid stringUsage: image id

pressedImageMargin ​

• get pressedImageMargin(): Readonly<Margin> other

• set pressedImageMargin(inMargin): void other

Get press image margins

Returns ​

Readonly<Margin>Press the image margin

Set press image margin

Parameters ​

inMargin MarginUsage: press the image margin

pressedImageSize ​

• get pressedImageSize(): Readonly<Vector2> other

• set pressedImageSize(inSize): void other

Get the size of pressing image

Returns ​

Readonly<Vector2>Press image size

Set the size of pressing image

Parameters ​

inSize Vector2Usage: Size

pressedMethod ​

• get pressedMethod(): ButtonPressMethod other

• set pressedMethod(inPressedMethod): void other

Acquire press mode

Returns ​

ButtonPressMethodPress mode

Set press mode

Parameters ​

inPressedMethod ButtonPressMethodUsage: Press mode selection

releasedDelegate ​

• get releasedDelegate(): MulticastDelegate<() => void> other

Release event

Returns ​

MulticastDelegate<() => void>Return the proxy of the event

roundBoxPercentOffset ​

• get roundBoxPercentOffset(): Vector2 other

• set roundBoxPercentOffset(percent): void other

Obtain the percentage size margin offset of the rectangle

Returns ​

Vector2Percentage of the offset of the size margin of the rectangle, 0~0.5

Set rectangle size margin offset

Parameters ​

percent Vector2Usage: rectangle size percentage, 0~0.5

roundBoxRadius ​

• get roundBoxRadius(): number

• set roundBoxRadius(value): void

Get the set corner radius

Returns ​

numberPercentage of corner radius

Set corner radius

Parameters ​

value numberPercentage of corner radius

roundBoxSharpness ​

• get roundBoxSharpness(): number

• set roundBoxSharpness(v): void

Get the set fillet sharpening degree

Returns ​

numberSharpness

Sharpening degree of rounded corners set

Parameters ​

v numberUsage: Sharpeness

roundBoxUVRatio ​

• get roundBoxUVRatio(): number

• set roundBoxUVRatio(v): void

Obtain rounded corner adjustment size

Returns ​

numberRounded corner adjustment size

Set rounded corners to adjust size

Parameters ​

v numberUsage: Adjust the size of rounded corners

touchMethod ​

• get touchMethod(): ButtonTouchMethod other

• set touchMethod(inTouchMethod): void other

Get touch mode

Returns ​

ButtonTouchMethodTouch mode

Set Touch mode

Parameters ​

inTouchMethod ButtonTouchMethodUsage: Touch mode selection

unHoveredDelegate ​

• get unHoveredDelegate(): MulticastDelegate<() => void> other

Unsettled event

Returns ​

MulticastDelegate<() => void>Return the proxy of the event

useMaskTextureOpacity ​

• get useMaskTextureOpacity(): boolean other

• set useMaskTextureOpacity(inUseWeight): void other

Get whether the mask outline is cull

Returns ​

booleanweight

Set whether the mask outline is cull

Parameters ​

inUseWeight booleanCull or not

Methods ​


addKey ​

• addKey(key): void other

The same button can only control one UI control at a time, and the latest bound UI control will overwrite the previous binding; The binding added in the script cannot override the UI controls bound to the same key in the editor's key binding menu. However, when two UI controls are bound to the same key separately through code and menu, the priority of using code binding is higher

Parameters ​

key KeysUsage: bound keys

getKeys ​

• getKeys(): Keys[] other

Get all the keyboard keys bound to the current UI widget, including the editor key binding menu and the code bound keys

Returns ​

Keys[]Return all keys bound to the current control, possibly empty

isPressed ​

• isPressed(): boolean other

Whether press

Returns ​

booleanIs the return button pressed

removeKey ​

• removeKey(key): void other

This operation only unbinds dynamically bound keys and cannot unbind keys bound in the editor's key binding menu

Parameters ​

key KeysUsage: Unbind button

setDisableImageColorByHex ​

• setDisableImageColorByHex(inHexString): void other

Set unavailable color to specify Hex's color text, set color # 05050505

Parameters ​

inHexString stringUsage: Color string range: A string type that conforms to the characteristics of Hex

setDisableImageColorDecimal ​

• setDisableImageColorDecimal(R, G, B, A): void other

Set disable Color

Parameters ​

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

setMaskImageColorByHex ​

• setMaskImageColorByHex(inHexString): void other

Set the mask image color Specify the color of Hex text Set Color # 05050505

Parameters ​

inHexString stringUsage: Color string range: A string type that conforms to the characteristics of Hex

setMaskImageColorDecimal ​

• setMaskImageColorDecimal(R, G, B, A): void other

Set mask image color

Parameters ​

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

setNormalImageColorByHex ​

• setNormalImageColorByHex(inHexString): void other

Set the color of the regular image and specify the color of Hex. Text setting color # 05050505

Parameters ​

inHexString stringUsage: Color string range: A string type that conforms to the characteristics of Hex

setNormalImageColorDecimal ​

• setNormalImageColorDecimal(R, G, B, A): void other

Set regular image colors

Parameters ​

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

setPressedImageColorByHex ​

• setPressedImageColorByHex(inHexString): void other

Set Press image Color Specify the color of Hex text Set Color # 05050505

Parameters ​

inHexString stringUsage: Color string range: A string type that conforms to the characteristics of Hex

setPressedImageColorDecimal ​

• setPressedImageColorDecimal(R, G, B, A): void other

Set the color of the pressed image

Parameters ​

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

newObject ​

• Static newObject(parent?, inName?): MaskButton other

Create Mask widget

Parameters ​

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

Returns ​

MaskButtonReturn the created object

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