Skip to content
VirtualJoystickPanel

UI / VirtualJoystickPanel

VirtualJoystickPanel Class ​

Joystick

Hierarchy ​

  • Widget

    ↳ VirtualJoystickPanel

Table of contents ​

Properties ​

click

Properties ​

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

Accessors ​

activeOpacity(): number other
Return the transparency when activated
backgroundDisabledImageId(): string other
Return to the background image disable status image id
backgroundImageDesigner(): JoystickStyleDesigner other
Return the background texture settings of the input, including normal clicks that are not enabled
backgroundImageId(): string other
Return to the center image general status image id
backgroundImageSize(): Vector2 other
Joystick background image size
backgroundTouchImageId(): string other
Return background image, press status, image ID
center(): Vector2 other
The input is the position of the joystick center. If it does not meet the expectation, the default value will be returned
centerDisableImageId(): string other
Return to the center image disable status image id
centerImageDesigner(): JoystickStyleDesigner other
Return to the input center texture settings, including the normal click not enable
centerImageId(): string other
Return to the center image general status image id
centerImageSize(): Vector2 other
Image size of joystick button
centerTouchImage(): string other
Return to the center image, press status, image ID
controlByMouseEnable(): boolean other
Obtaining whether it is control by the mouse only works on the PC side
controlType(): CameraControlType other
The type of joystick is returned. If it does not meet the expectation, the default value will be returned
inActiveOpacity(): number other
Return transparency when not activated
inputScale(): Vector2 other
Returns the input ratio of the input
isLocationFixed(): boolean other
After dragging, is the joystick position fixed
onInputDir(): MulticastDelegate<(vec: Vector2) => void> other
Enter mobile event
onJoyStickDown(): MulticastDelegate<() => void> other
Proxy for joystick press events
onJoyStickUp(): MulticastDelegate<() => void> other
Proxy for the joystick up event
timeUntilInactive(): number other
Time to enter the non activate state
timeUntilReset(): number other
Reset time after releasing the joystick
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: JoystickBindKeyType): 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(): JoystickBindKeyType[] other
Get all the keyboard keys bound to the current UI widget, including the editor key binding menu and the code bound keys
removeKey(key: JoystickBindKeyType): void other
This operation only unbinds dynamically bound keys and cannot unbind keys bound in the editor's key binding menu
resetJoyStick(): void other
Forcibly reset the joystick - for example, hide its parent node when manipulating the joystick, and then the joystick cannot be reset successfully after it is redisplayed
setVisibility(Visibility: SlateVisibility): void other
Set Visible
newObject(Outer?: Widget, InName?: string): VirtualJoystickPanel other
Create VirtualJoystick PanelDesigner control
newObjectAndAdd(InCanvas?: Canvas, Outer?: Widget, InName?: string): VirtualJoystickPanel other
Create TouchPad controls
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 ​

activeOpacity ​

• get activeOpacity(): number other

• set activeOpacity(Value): void other

Return the transparency when activated

Returns ​

numberReturn the transparency when activated

Set transparency when activate

Parameters ​

Value numberUsage: Transparency

backgroundDisabledImageId ​

• get backgroundDisabledImageId(): string other

• set backgroundDisabledImageId(id): void other

Return to the background image disable status image id

Returns ​

stringReturn to the background image disable status image id

Set background image disabled status image ID

Parameters ​

id stringUsage: asset id

backgroundImageDesigner ​

• get backgroundImageDesigner(): JoystickStyleDesigner other

Return the background texture settings of the input, including normal clicks that are not enabled

Returns ​

JoystickStyleDesignerReturn the background texture settings of the input, including normal clicks that are not enabled

backgroundImageId ​

• get backgroundImageId(): string other

• set backgroundImageId(id): void other

Return to the center image general status image id

Returns ​

stringReturn to the center image general status image id

Set the background image general status image id

Parameters ​

id stringUsage: asset id

backgroundImageSize ​

• get backgroundImageSize(): Vector2 other

• set backgroundImageSize(inSize): void other

Joystick background image size

Returns ​

Vector2Joystick background image size

Joystick background image size

Parameters ​

inSize Vector2Usage: joystick background image size

backgroundTouchImageId ​

• get backgroundTouchImageId(): string other

• set backgroundTouchImageId(id): void other

Return background image, press status, image ID

Returns ​

stringReturn background image, press status, image ID

Set the background image pressing status image id

Parameters ​

id stringUsage: asset id

center ​

• get center(): Vector2 other

• set center(inValue): void other

The input is the position of the joystick center. If it does not meet the expectation, the default value will be returned

Returns ​

Vector2The input is the center position of the joystick, which does not meet expectations and will return the default value

Set the central position of the input

Parameters ​

inValue Vector2Usage: new central position

centerDisableImageId ​

• get centerDisableImageId(): string other

• set centerDisableImageId(id): void other

Return to the center image disable status image id

Returns ​

stringReturn to the center image disable status image id

Set center image disable status image id

Parameters ​

id stringUsage: asset id

centerImageDesigner ​

• get centerImageDesigner(): JoystickStyleDesigner other

Return to the input center texture settings, including the normal click not enable

Returns ​

JoystickStyleDesignerReturn to the central texture settings

centerImageId ​

• get centerImageId(): string other

• set centerImageId(id): void other

Return to the center image general status image id

Returns ​

stringReturn to the center image general status image id

Set the center image general status image id

Parameters ​

id stringUsage: asset id

centerImageSize ​

• get centerImageSize(): Vector2 other

• set centerImageSize(inSize): void other

Image size of joystick button

Returns ​

Vector2Image size of joystick button

Image size of joystick button

Parameters ​

inSize Vector2Usage: joystick button image size

centerTouchImage ​

• get centerTouchImage(): string other

• set centerTouchImage(id): void other

Return to the center image, press status, image ID

Returns ​

stringReturn to the center image, press status, image ID

Center image pressing status image id

Parameters ​

id stringUsage: asset id

controlByMouseEnable ​

• get controlByMouseEnable(): boolean other

• set controlByMouseEnable(controlByMouse): void other

Obtaining whether it is control by the mouse only works on the PC side

Returns ​

booleanIs it controlled by the mouse

Set whether it is control by the mouse, which only works on the PC end

Parameters ​

controlByMouse booleanIs it controlled by the mouse

controlType ​

• get controlType(): CameraControlType other

• set controlType(NewControlType): void other

The type of joystick is returned. If it does not meet the expectation, the default value will be returned

Returns ​

CameraControlTypeReturn the input joystick type

Set the input joystick type, character movement and skill joystick movement type

Parameters ​

NewControlType CameraControlTypeUsage: joystick type

inActiveOpacity ​

• get inActiveOpacity(): number other

• set inActiveOpacity(Value): void other

Return transparency when not activated

Returns ​

numberReturn transparency when not activated

Set transparency when inactive

Parameters ​

Value numberUsage: Transparency

inputScale ​

• get inputScale(): Vector2 other

• set inputScale(inScale): void other

Returns the input ratio of the input

Returns ​

Vector2Returns the input ratio of the input

Set the input ratio for input

Parameters ​

inScale Vector2Usage: new input ratio

isLocationFixed ​

• get isLocationFixed(): boolean other

• set isLocationFixed(enable): void other

After dragging, is the joystick position fixed

Returns ​

booleanboolean

After dragging, is the joystick position fixed

Parameters ​

enable booleanUsage: Whether the position of the joystick is fixed

onInputDir ​

• get onInputDir(): MulticastDelegate<(vec: Vector2) => void> other

Enter mobile event

Returns ​

MulticastDelegate<(vec: Vector2) => void>Enter mobile event

onJoyStickDown ​

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

Proxy for joystick press events

Returns ​

MulticastDelegate<() => void>Delegate for press joystick event

onJoyStickUp ​

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

Proxy for the joystick up event

Returns ​

MulticastDelegate<() => void>Delegate for Lift joystick Event

timeUntilInactive ​

• get timeUntilInactive(): number other

• set timeUntilInactive(Value): void other

Time to enter the non activate state

Returns ​

numberTime to enter the inactive state, in seconds

Time to enter the non activate state

Parameters ​

Value numberUsage: Time to enter the inactive state, in seconds

timeUntilReset ​

• get timeUntilReset(): number other

• set timeUntilReset(Value): void other

Reset time after releasing the joystick

Returns ​

numberReset time in seconds

Reset time after releasing the joystick

Parameters ​

Value numberUsage: Reset time in seconds

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 JoystickBindKeyTypeUsage: button

getKeys ​

• getKeys(): JoystickBindKeyType[] other

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

Returns ​

JoystickBindKeyType[]Returns the key bound to the current widget, which may be empty

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 JoystickBindKeyTypeUsage: button

resetJoyStick ​

• resetJoyStick(): void other

Forcibly reset the joystick - for example, hide its parent node when manipulating the joystick, and then the joystick cannot be reset successfully after it is redisplayed


setVisibility ​

• setVisibility(Visibility): void other

Set Visible

Parameters ​

Visibility SlateVisibilityUsage: Visibility

newObject ​

• Static newObject(Outer?, InName?): VirtualJoystickPanel other

Create VirtualJoystick PanelDesigner control

Parameters ​

Outer? WidgetUsage: create the outer outer object of the widget default: null
InName? stringUsage: name of the create widget default: null range: set a reasonable name

Returns ​

VirtualJoystickPanelReturn the created control

newObjectAndAdd ​

• Static newObjectAndAdd(InCanvas?, Outer?, InName?): VirtualJoystickPanel other

Create TouchPad controls

Parameters ​

InCanvas? CanvasUsage: Parent node default: null
Outer? WidgetUsage: create the outer outer object of the widget default: null
InName? stringCreate the name of the widget default: null range: set a reasonable name

Returns ​

VirtualJoystickPanelReturn the created object

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