RSX Code Reference
    Preparing search index...

    Class UIElement

    Base class for all UI elements. Every UI element can at least be positioned in it's parent layout/panel and be hidden/visible, focused/unfocused and assigned a context menu.

    Hierarchy (View Summary)

    Index
    • Constructs the UIElement and uses mainElement as the main layout element.

      Parameters

      Returns UIElement

      This constructor is used when building custom UIElements that maintain their own layout and element hierarchy. A typical element that is used as main would be a subclass of UILayout such as UIHorizontalLayout.

    • Constructs the UIElement and uses mainElement as the main layout element.

      Parameters

      Returns UIElement

      This constructor is used when building custom UIElements that maintain their own layout and element hierarchy. A typical element that is used as main would be a subclass of UILayout such as UIHorizontalLayout.

    • Constructs the UIElement and uses mamainElementin as the main layout element.

      Parameters

      Returns UIElement

      This constructor is used when building custom UIElements that maintain their own layout and element hierarchy. A typical element that is used as main would be a subclass of UILayout such as UIHorizontalLayout.

    • get borderRadiusBottomLeft(): number

      Sets the border radius of the style used by this element.

      Returns number

    • set borderRadiusBottomLeft(value: number): void

      Parameters

      • value: number

      Returns void

    • get borderRadiusBottomRight(): number

      Sets the border radius of the style used by this element.

      Returns number

    • set borderRadiusBottomRight(value: number): void

      Parameters

      • value: number

      Returns void

    • get borderRadiusTopLeft(): number

      Sets the border radius of the style used by this element.

      Returns number

    • set borderRadiusTopLeft(value: number): void

      Parameters

      • value: number

      Returns void

    • get borderRadiusTopRight(): number

      Sets the border radius of the style used by this element.

      Returns number

    • set borderRadiusTopRight(value: number): void

      Parameters

      • value: number

      Returns void

    • get borderWidth(): number

      Sets new border width to be used by the element.

      Returns number

    • set borderWidth(value: number): void

      Parameters

      • value: number

      Returns void

    • get bounds(): Immutable<rsx.UIRectPoint>

      Sets the bounds of the UI element. Relative to a parent UI panel. Equivalent to calling setPosition(), setWidth() and setHeight().

      If scalable is set to true, the size will be scaled linearly with the DPI scaling factor of the surface the elements gets attached. It false, the element will have this exact size no matter the DPI scaling factor.

      Returns Immutable<rsx.UIRectPoint>

    • set bounds(value: Immutable<rsx.UIRectPoint>): void

      Parameters

      Returns void

    • get boundsInPixels(): Immutable<Rect2>

      Gets or sets non-clipped bounds of the UI element in pixels. Relative to a parent UI panel.

      Returns Immutable<Rect2>

    • set boundsInPixels(value: Immutable<Rect2>): void

      Parameters

      Returns void

    • get clippedBoundsInPixels(): Immutable<rsx.UIRectPixel>

      Gets UI element bounds relative to parent surface, clipped by specified clip rect.

      Returns Immutable<rsx.UIRectPixel>

    • get clippedVisibleBounds(): Immutable<rsx.UIRectPoint>

      Returns the clipped bounds of the UI element including the margins. Relative to a parent UI panel.

      Returns Immutable<rsx.UIRectPoint>

    • get clippedVisibleBoundsInPixels(): Immutable<rsx.UIRectPixel>

      Returns the clipped bounds of the UI element including the margins. Relative to a parent UI panel.

      Returns Immutable<rsx.UIRectPixel>

    • get clippedVisibleScreenBounds(): Immutable<rsx.UIRectPoint>

      Returns the clipped bounds of the UI element including the margins. In Screenspace.

      Returns Immutable<rsx.UIRectPoint>

    • get clippedVisibleScreenBoundsInPixels(): Immutable<rsx.UIRectPixel>

      Returns the clipped bounds of the UI element including the margins. In Screenspace.

      Returns Immutable<rsx.UIRectPixel>

    • get contentPaddingBottom(): number

      Sets the content padding of the style used by this element.

      Returns number

    • set contentPaddingBottom(value: number): void

      Parameters

      • value: number

      Returns void

    • get contentPaddingLeft(): number

      Sets the content padding of the style used by this element.

      Returns number

    • set contentPaddingLeft(value: number): void

      Parameters

      • value: number

      Returns void

    • get contentPaddingRight(): number

      Sets the content padding of the style used by this element.

      Returns number

    • set contentPaddingRight(value: number): void

      Parameters

      • value: number

      Returns void

    • get contentPaddingTop(): number

      Sets the content padding of the style used by this element.

      Returns number

    • set contentPaddingTop(value: number): void

      Parameters

      • value: number

      Returns void

    • get contextMenu(): UIContextMenu

      Assigns a new context menu that will be opened when the element is right clicked. Null is allowed in case no context menu is wanted.

      Returns UIContextMenu

    • set contextMenu(value: UIContextMenu): void

      Parameters

      Returns void

    • get debugName(): string

      Sets the debug name for the UI element.

      Returns string

    • set debugName(value: string): void

      Parameters

      • value: string

      Returns void

    • get disabled(): boolean

      Disables or enables the element. Disabled elements cannot be interacted with and have a faded out appearance.

      Returns boolean

    • set disabled(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get displayType(): EnumValue<UIDisplayType>

      Hides or shows this element and recursively applies the same state to all the child elements. This will not remove the element from the layout, the room for it will still be reserved but it just won't be visible.

      Returns EnumValue<UIDisplayType>

    • set displayType(value: EnumValue<UIDisplayType>): void

      Parameters

      Returns void

    • get dpiScale(): number

      Gets the scaling factor for the element's parent surface. This element must be attached to a valid surface in order to retrieve the scale factor. If the element is not attached to a surface, 1.0 is returned.

      Returns number

      The scale factor for the element's parent surface.

    • get elementDepth(): number

      Set element part of element depth. Less significant than both surface and area depth.

      Returns number

    • set elementDepth(value: number): void

      Parameters

      • value: number

      Returns void

    • get fixedHeight(): number

      Sets the element size to be fixed using the specified value.

      Returns number

    • set fixedHeight(value: number): void

      Parameters

      • value: number

      Returns void

    • set fixedHeightInPixels(value: number): void

      Sets the element size to be fixed using the specified value in pixels.

      Parameters

      • value: number

      Returns void

    • get fixedWidth(): number

      Sets the element size to be fixed using the specified value.

      Returns number

    • set fixedWidth(value: number): void

      Parameters

      • value: number

      Returns void

    • set fixedWidthInPixels(value: number): void

      Sets the element size to be fixed using the specified value in pixels.

      Parameters

      • value: number

      Returns void

    • get flexibleHeight(): Immutable<Range>

      Sets a flexible element height in points. The element will be resized according to its contents and parent layout but will always stay within the provided range. If maximum height is zero, the element is allowed to expand as much as it needs.

      Returns Immutable<Range>

    • set flexibleHeight(value: Immutable<Range>): void

      Parameters

      Returns void

    • get flexibleWidth(): Immutable<Range>

      Sets a flexible element width in points. The element will be resized according to its contents and parent layout but will always stay within the provided range. If maximum width is zero, the element is allowed to expand as much as it needs.

      Returns Immutable<Range>

    • set flexibleWidth(value: Immutable<Range>): void

      Parameters

      Returns void

    • get focusProxy(): UIElement

      Gets the focus proxy element.

      Returns UIElement

    • set focusProxy(value: UIElement): void

      Parameters

      Returns void

    • get isAcceptingKeyFocus(): boolean

      Determines if the element can be navigated to by using keys/buttons (e.g. the 'Tab' button on the keyboard.

      Returns boolean

    • set isAcceptingKeyFocus(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get isActive(): boolean

      Determines if the element is currently being "clicked" by a pointer device or keyboard input.

      Returns boolean

    • set isActive(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get isDestroyed(): boolean

      Checks if the underlying native UIElement has been destroyed.

      Returns boolean

    • get isDragAndDropTarget(): boolean

      Determines if the element is a drag and drop target which will receive drag and drop events.

      Returns boolean

    • set isDragAndDropTarget(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get isEventPassThrough(): boolean

      Determines will this element block elements underneath it from receiving events like pointer click, hover on/off or be able to gain focus. True by default.

      Returns boolean

    • set isEventPassThrough(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get isFixedHeight(): boolean

      Determines if this element is a fixed on its height.

      Returns boolean

    • get isFixedWidth(): boolean

      Determines if this element is a fixed on its width.

      Returns boolean

    • get isFlexibleHeight(): boolean

      Determines if this element is a flexible on its height.

      Returns boolean

    • get isFlexibleWidth(): boolean

      Determines if this element is a flexible on its width.

      Returns boolean

    • get isFocused(): boolean

      Determines if the element is currently being focused, typically in a state to accept for keyboard input.

      Returns boolean

    • set isFocused(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get isFullyClipped(): boolean

      Determines if the element is currently fully clipped (either the clipped bounds width or height are 0).

      Returns boolean

    • get isHovered(): boolean

      Determines if the element is currently hovered by a pointer device.

      Returns boolean

    • set isHovered(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get isHoverEventPassThrough(): boolean

      Determines if the element is receives hover events.

      Returns boolean

    • set isHoverEventPassThrough(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get isIgnoreFocus(): boolean

      Determines if the element can be focused by clicking on it.

      Returns boolean

    • set isIgnoreFocus(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get isInteractiveFill(): boolean

      Determines if the element fill is interactive based on mouse events. This requires mouse-move events to be enabled.

      Returns boolean

    • set isInteractiveFill(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get isInteractiveStroke(): boolean

      Determines if the element stroke is interactive based on mouse events. This requires mouse-move events to be enabled.

      Returns boolean

    • set isInteractiveStroke(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get isLayoutBarrier(): boolean

      Specifies that layout passes of children elements should start from this element.

      Returns boolean

    • set isLayoutBarrier(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get isOn(): boolean

      Determines if the element is currently being "clicked" by a pointer device or keyboard input.

      Returns boolean

    • set isOn(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get isOverflowBarrier(): boolean

      Specifies that overflow content (e.g. shadows from CSS filters) are clipped at this element's bounds.

      Returns boolean

    • set isOverflowBarrier(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get isReceivingHoverEvents(): boolean

      Determines if the element is receives hover events.

      Returns boolean

    • set isReceivingHoverEvents(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get isReceivingMouseMoveEvents(): boolean

      Determines if the element is receives hover events.

      Returns boolean

    • set isReceivingMouseMoveEvents(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get isUpdating(): boolean

      Specifies that per-frame updates are enabled. If enabled, the element's onUpdate method will be called every frame.

      Returns boolean

      Per-frame updates are expensive and most UI elements should be built using a fully event-driven approach. Do not enable per-frame updates unless there is no event available that can be used to drive the required behavior.

    • set isUpdating(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get isVisible(): boolean

      Activates or deactivates this element and recursively applies the same state to all the child elements. This has the same effect as SetDisplayType(UIDisplayType::Hidden), but when disabled it will also remove the element from the layout, essentially having the same effect is if you destroyed the element.

      Returns boolean

    • set isVisible(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get minimumHeight(): number

      Sets the minimum height in points of the element when used in a layout.

      Returns number

    • set minimumHeight(value: number): void

      Parameters

      • value: number

      Returns void

    • get minimumWidth(): number

      Sets the minimum width in points of the element when used in a layout.

      Returns number

    • set minimumWidth(value: number): void

      Parameters

      • value: number

      Returns void

    • Sets a navigation group that determines in what order are UI elements visited when using a keyboard or gamepad to switch between the elements. If you don't set a navigation group the elements will inherit the default navigation group from their parent UISurface. Also see SetNavigationGroupIndex().

      Returns UINavGroup

    • Parameters

      Returns void

    • get paddingBottom(): number

      Sets the padding of the style used by this element.

      Returns number

    • set paddingBottom(value: number): void

      Parameters

      • value: number

      Returns void

    • get paddingLeft(): number

      Sets the padding of the style used by this element.

      Returns number

    • set paddingLeft(value: number): void

      Parameters

      • value: number

      Returns void

    • get paddingRight(): number

      Sets the padding of the style used by this element.

      Returns number

    • set paddingRight(value: number): void

      Parameters

      • value: number

      Returns void

    • get paddingTop(): number

      Sets the padding of the style used by this element.

      Returns number

    • set paddingTop(value: number): void

      Parameters

      • value: number

      Returns void

    • get parent(): UIElementBase

      Returns the layout this element belongs to, if any.

      Returns UIElementBase

    • get position(): Immutable<rsx.UIPoint>

      Sets element position relative to parent UI panel in points.

      Returns Immutable<rsx.UIPoint>

      Be aware that this value will be ignored if UI element is part of a layout since then the layout controls its placement.

    • set position(value: Immutable<rsx.UIPoint>): void

      Parameters

      Returns void

    • set positionInteger(value: Immutable<rsx.UIPixel>): void

      Sets element position relative to parent UI panel in pixels.

      Parameters

      Returns void

      Be aware that this value will be ignored if UI element is part of a layout since then the layout controls its placement.

    • get readOnly(): boolean

      Disables or enables the element. Disabled elements cannot be interacted with and have a faded out appearance.

      Returns boolean

    • set readOnly(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get screen(): Screen

      Returns the screen on which the element is displayed, if any.

      Returns Screen

    • get screenBounds(): Immutable<rsx.UIRectPoint>

      Returns non-clipped bounds of the UI element in screenspace.

      Returns Immutable<rsx.UIRectPoint>

      This call can be potentially expensive if the UI state is dirty.

    • get screenBoundsInPixels(): Immutable<rsx.UIRectPixel>

      Returns non-clipped bounds of the UI element in screenspace.

      Returns Immutable<rsx.UIRectPixel>

      This call can be potentially expensive if the UI state is dirty.

    • get sizeHint(): Immutable<rsx.UISizePoint>

      Gets the size hint for this element.

      Returns Immutable<rsx.UISizePoint>

      The size hint represents an approximation of the size. The actual size depends on the layouting that is done by the parent element. Layouts typically use the size hint to calculate the intial size of the element when distributing the available layout space.

    • get sizeHintInPixels(): Immutable<rsx.UISizePixel>

      Gets the size hint for this element.

      Returns Immutable<rsx.UISizePixel>

      The size hint represents an approximation of the size. The actual size depends on the layouting that is done by the parent element. Layouts typically use the size hint to calculate the intial size of the element when distributing the available layout space.

    • get style(): string

      Sets new style to be used by the element.

      Returns string

    • set style(value: string): void

      Parameters

      • value: string

      Returns void

    • get styleClassName(): string

      Sets the CSS class names for this element (space-separated).

      Returns string

    • set styleClassName(value: string): void

      Parameters

      • value: string

      Returns void

    • get styleElementId(): string

      Sets the element ID for CSS selectors.

      Returns string

    • set styleElementId(value: string): void

      Parameters

      • value: string

      Returns void

    • get visibleBounds(): Immutable<rsx.UIRectPoint>

      Returns non-clipped visible bounds of the UI element (bounds exclude the margins). Relative to the parent UI panel.

      Returns Immutable<rsx.UIRectPoint>

      This call can be potentially expensive as the bounds need to be calculated based on current UI state.

    • get visibleBoundsInPixels(): Immutable<rsx.UIRectPixel>

      Returns non-clipped visible bounds of the UI element (bounds exclude the margins). Relative to the parent UI panel.

      Returns Immutable<rsx.UIRectPixel>

      This call can be potentially expensive as the bounds need to be calculated based on current UI state.

    • get window(): RenderWindow

      Get the window in which the element is positioned.

      Returns RenderWindow

    • Adds a CSS class to the element.

      Parameters

      • className: string

        The class name to add.

      Returns void

    • Creates an animation that executes an action lambda once the delay elapsed.

      Parameters

      • action: () => void

        The action to execute.

      • Optionaldelay: number

        The delay until the action is executed. Defaults to no delay.

      • Optionalrepeating: number | boolean

        Whether the animation should repeat or not. Defaults to false. Set to true, to repeat forever. Set to false, to never repeat. Set to a number, to indicate the repeat count.

      Returns EditorAnimation

      The created animation.

    • Animates a property of the UIElement. The animation is automatically started.

      Type Parameters

      • T

        The type of property to be animated.

      Parameters

      • propertyName: string

        The name of the property to be animated on the UIElement.

      • starting: T

        The starting value of the property.

      • ending: T

        The ending value of the property.

      • Optionalduration: number

        The animation duration in seconds. Defaults to 1 seconds.

      • OptionaleasingCurve: Const<EasingCurve>

        The easing curve to be used. Defaults to

      • Optionalrepeating: number | boolean

        Whether the animation should repeat or not. Defaults to false. Set to true, to repeat forever. Set to false, to never repeat. Set to a number, to indicate the repeat count.

      Returns EditorAnimation

      The created animation.

      EasingCurve.inOutQuadratic.

    • Animates a property of the UIElement using a generic lambda function. The animation is automatically started.

      Type Parameters

      • T

      Parameters

      • setter: (value: T) => void

        The lambda that is called when the value is updated. The lambda should be used to assign the value on the u

      • starting: T

        The starting value of the property.

      • ending: T

        The ending value of the property.

      • Optionalduration: number

        The animation duration in seconds. Defaults to 1 seconds.

      • OptionaleasingCurve: Const<EasingCurve>

        The easing curve to be used. Defaults to

      • Optionalrepeating: number | boolean

        Whether the animation should repeat or not. Defaults to false. Set to true, to repeat forever. Set to false, to never repeat. Set to a number, to indicate the repeat count.

      Returns EditorAnimation

      The created animation.

      EasingCurve.inOutQuadratic.

    • Creates an animation that takes delay seconds to execute.

      Parameters

      • delay: number

        The delay in seconds.

      Returns EditorAnimation

      The created animation.

      This animation is usedful when creating compound animations that are chained together by calls to then. This is helpful to create an animation that performs an action, waits and performs another action.

    • Clears a previously assigend cursor.

      Returns void

    • Virtual

      Called when a command event is triggered. Return true if you have processed the event and don't want other elements to process it.

      Parameters

      Returns boolean

    • Converts the surface (typically a window) position to local coordinates.

      Parameters

      Returns Vector2

    • Parameters

      Returns Vector2

    • Virtual

      Destroys this element and all its children. Removes the element from parent layout/panel.

      Returns void

      Calling methods on a destroyed element is a no-operation. Destroyed elements aren't allowed to be assigned as children of other elements, or be parents of other elements.

    • Updates the layout of the UI element. Updates child elements positions, sizes, clip rectangles and depths so they fit into the provided bounds, while respecting their layout options.

      Returns void

      This may trigger the layout of more than this element and it's children! It can potentially update the layout of the whole UI tree.

    • If isBlocking is true, events emitted by this object are blocked. If isBlocking is false, no blocking will occur and events will be triggered normally.

      Events emitted while being blocked are not buffered.

      Returns boolean

      whether the element is already blocking events or not.

    • Returns non-clipped bounds of the UI element. Relative to a parent UI panel.

      Parameters

      • OptionalrelativeTo: UIElementBase

        Parent panel of the provided element relative to which to return the bounds. If null the bounds relative to the first parent panel are returned. Behavior is undefined if provided panel is not a parent of the element.

      Returns Rect2

      This call can be potentially expensive if the UI state is dirty.

    • Checks if the element has a specific CSS class.

      Parameters

      • className: string

        The class name to check.

      Returns boolean

      True if the class is present.

    • Virtual

      Checks is the specified position within UI element bounds. Position is relative to parent UI surface.

      Parameters

      Returns boolean

    • Virtual

      Called when a mouse event is received on any UI element the mouse is interacting with. Return true if you have processed the event and don't want other elements to process it.

      Parameters

      Returns boolean

    • Virtual

      Called when the element has been added to a surface or window.

      Returns void

      This event allows to immediately access the layout data and bounds of the element and it's immediate parents and children. The event is helpful to perform initialization and registration to events. Implementing classes must call super.

    • Virtual

      Called when the element has been removed from a surface or window.

      Returns void

      Layout data and bounds will no longer be available at this point. The event is helpful to perform cleanup and unregistration from events. Implementing classes must call super.

    • Virtual

      Called when the element has been registered with its parent.

      Returns void

    • Virtual

      Invoked when the UI requests the UIElement to create a custom tooltip.

      Returns UIElementBase

      A UIElement that contains the tooltip content.

      An element must be returned that is not yet added to a UI hierarchy. If the element is already added to a hierachy, it will be removed and disposed once the tooltip finished. However, it is acceptable to preallocate a UIElement and always return the same UIElement.

    • Virtual

      Called when the element is about to be unregistered from its parent.

      Returns void

    • Virtual

      Called when the element is updating.

      Returns void

      This is method is only called if the element has been marked as requiring updates.

      Per-frame updates are expensive and most UI elements should be built using a fully event-driven approach. Do not enable per-frame updates unless there is no event available that can be used to drive the required behavior.

    • Removes a CSS class from the element.

      Parameters

      • className: string

        The class name to remove.

      Returns void

    • Virtual

      Resets element dimensions to their initial values dictated by the element's style.

      Returns void

    • If isBlocking is true, events emitted by this object are blocked. If isBlocking is false, no blocking will occur and events will be triggered normally.

      Events emitted while being blocked are not buffered.

      Parameters

      • isBlocking: boolean

        Should the element block events

      Returns boolean

      whether the element is already blocking events or not.

    • Sets the border radius of the style used by this element.

      Parameters

      • Optionalvalue: number

      Returns void

    • Sets the bounds of the UI element. Relative to a parent UI panel. Equivalent to calling setPosition(), setWidth() and setHeight().

      If scalable is set to true, the size will be scaled linearly with the DPI scaling factor of the surface the elements gets attached. It false, the element will have this exact size no matter the DPI scaling factor.

      Parameters

      Returns void

    • Sets the content padding of the style used by this element.

      Parameters

      • Optionalvalue: number

      Returns void

    • Assigns a custom cursor type.

      Parameters

      Returns any

    • Assigns a custom cursor named cursor with name.

      Parameters

      • name: string

      Returns any

      Custom named cursors can be registered with a call to Cursor::SetCursorIcon. When running in the editor, you can also use a cursor from the EditorCursorName enum.

    • Change the UI element focus state, will clear focus of any currently focussed element.

      Parameters

      • isEnabled: boolean

        Give the element focus or take it away.

      Returns void

    • Sets the padding of the style used by this element.

      Parameters

      • Optionalvalue: number

      Returns void

    • Virtual

      Called when a shortcut action is triggered and the UI element has input focus. Return true if you have processed the event and don't want other elements to process it.

      Parameters

      Returns boolean

    • Unregisters all running animations for the UIElement.

      Returns number

      The number of animations that were unregistered.

    • Virtual

      Called when some text is input and the UI element has input focus. Return true if you have processed the event and don't want other elements to process it.

      Parameters

      Returns boolean

    • Toggles a CSS class on the element.

      Parameters

      • className: string

        The class name to toggle.

      Returns boolean

      True if the class is now present, false otherwise.

    • Scales a point value by using the element's DPI scale to the current pixel value.

      Parameters

      • valueInPoints: number

        The element to scale a value for. This element must be attached to a valid widget in order to retrieve the scale factor. If the element is not attached to a widget, no scaling is performed.

      Returns number

      The value in pixels.

    • Converts a pixel value to points by using the element's DPI scale.

      Parameters

      • valueInPixels: number

        The element to scale a value for. This element must be attached to a valid widget in order to retrieve the scale factor. If the element is not attached to a widget, no scaling is performed.

      Returns number

      The value in points.

    • A helper method used to trigger UI events. This method does some special checking if events are blocked for the current UI element and, if blocked, will not trigger the event.

      Type Parameters

      • T extends any[]

      Parameters

      • event: Event<T>

        The event to be triggered if events are not blocked.

      • ...args: T

        A set of optional arguments to be passed to the event operator() call.

      Returns void

    • Virtual

      Called when a virtual button is pressed/released and the UI element has input focus. Return true if you have processed the event and don't want other elements to process it.

      Parameters

      Returns boolean

    • Virtual

      Executes the given action with blocked events on the UI element. The events are restored before returning.

      Parameters

      • action: () => void

        The action to be executed while events are blocked.

      Returns void

    onFocusGained: Event<[]>

    Triggered when the element gains focus.

    onFocusLost: Event<[]>

    Triggered when the element loses focus.

    onMouseEnter: Event<[]>

    Triggered when the mouse enters over the UI element.

    onMouseLeave: Event<[]>

    Triggered when the mouse leaves the UI element.

    onClickUp: Event<[]>

    Triggered when the element was clicked.

    onCustomContextMenuRequested: Event<[], UIContextMenu>

    Triggered when the element requests the creation of a context menu.

    onStateChanged: Event<
        [
            previousState: EnumValue<UIElementState, number>,
            currentState: EnumValue<UIElementState, number>,
        ],
    >

    Triggered when the element state changes.

    onLayoutSizeChanged: Event<
        [oldSize: Immutable<Size2>, newSize: Immutable<Size2>],
    >

    Event fired whenever the UI element size changes from a layout update.

    The old size of the UI element, in points.

    The new size of the UI element, in points.

    onRegistrationChanged: Event<[isRegistered: boolean]>

    Event fired whenever the UI element is registered with or unregistered from a parent element.

    This does not mean that the element is currently visible on screen or that it is part of a layout. Use onActiveSurfaceChanged to determine if the element is part of a layout that is currently rendered.

    True if the new state is registered in a parent element.

    onActiveSurfaceChanged: Event<[isRegistered: boolean]>

    Event fired whenever the UI element is registered with or unregistered from a surface.

    True if the new state is registered in a surface.