Creates a new grid layout with the given size of each cell/tile.
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.
The cell spacing in points.
Returns number of child elements in the layout.
Returns an array of all children of this layout.
Gets the content padding in points.
Sets the debug flags for the UI element.
Sets the debug name for the UI element.
Disables or enables the element. Disabled elements cannot be interacted with and have a faded out appearance.
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.
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.
The scale factor for the element's parent surface.
Sets the element size to be fixed using the specified value.
Sets the element size to be fixed using the specified value in pixels.
Sets the element size to be fixed using the specified value.
Sets the element size to be fixed using the specified value in pixels.
Determines if the layout should auto-resize to better fit tiles into the available space.
Checks if the underlying native UIElement has been destroyed.
Specifies that layout passes of children elements should start from this element.
Specifies that per-frame updates are enabled. If enabled, the element's onUpdate method will be called every frame.
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.
Sets the horizontal alignment of the element when used in a layout.
Sets the vertical alignment of the element when used in a layout.
Sets the minimum height in points of the element when used in a layout.
Sets the minimum width in points of the element when used in a layout.
Returns the layout this element belongs to, if any.
Sets element position relative to parent UI panel in pixels.
Disables or enables the element. Disabled elements cannot be interacted with and have a faded out appearance.
The row spacing in points.
Get the window in which the element is positioned.
Adds a new element to the layout after all existing elements. param element The new element to add.
Adds a new flexible space as a child of this layout. Flexible space expands to fill all available space in the layout. Space is inserted after all existing elements.
Newly created flexible space.
Adds a new UIGridLayout as a child of this layout. Layout is inserted after all existing elements.
Newly created vertical layout.
Adds a new horizontal layout as a child of this layout. Layout is inserted after all existing elements.
Rest...options: UIOption[]Options that allow you to control how is the layout positioned and sized.
Newly created horizontal layout.
Add a new vertical separator. The horizontal separator is a line that can be used to visually separate elements in a layout.
Newly created separator.
Adds a new UI panel as a child of this layout. Panel is inserted after all existing elements.
Depth at which to position the panel. Panels with lower depth will be displayed in front of panels with higher depth. Provided depth is relative to the depth of the parent UI panel. The depth value will be clamped if outside of the depth range of the parent UI panel.
Rest...options: UIOption[]Options that allow you to control how is the panel positioned and sized.
Newly created UI panel.
Adds a new UI panel as a child of this layout. Panel is inserted after all existing elements.
Depth at which to position the panel. Panels with lower depth will be displayed in front of panels with higher depth. Provided depth is relative to the depth of the parent UI panel. The depth value will be clamped if outside of the depth range of the parent UI panel.
Smallest depth offset allowed by any child UI panels. If a child panel has a depth offset lower than this value it will be clamped.
Largest depth offset allowed by any child UI panels. If a child panel has a depth offset higher than this value it will be clamped.
Rest...options: UIOption[]Options that allow you to control how is the panel positioned and sized.
Newly created UI panel.
Adds a new fixed space object. Fixed space inserts a blank space with specific width or height (depending on layout type) in the layout. Space is inserted after all existing elements.
Size of the space in pixels. This will represent either width or height depending whether the layout is vertical or horizontal.
Optionalscalable: booleanIf this is true, this value will be scaled by the widget scaling factor.
Newly created fixed space.
Adds a new vertical layout as a child of this layout. Layout is inserted after all existing elements.
Rest...options: UIOption[]Options that allow you to control how is the layout positioned and sized.
Newly created vertical layout.
Add a new vertical separator. The vertical separator is a line that can be used to visually separate elements in a layout.
Newly created separator.
Creates an animation that executes an action lambda once the delay elapsed.
The action to execute.
Optionaldelay: numberThe delay until the action is executed. Defaults to no delay.
Optionalrepeating: number | booleanWhether 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.
The created animation.
Animates a property of the UIElement. The animation is automatically started.
The name of the property to be animated on the UIElement.
The starting value of the property.
The ending value of the property.
Optionalduration: numberThe animation duration in seconds. Defaults to 1 seconds.
OptionaleasingCurve: Const<EasingCurve>The easing curve to be used. Defaults to
Optionalrepeating: number | booleanWhether 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.
The created animation.
Animates a property of the UIElement using a generic lambda function. The animation is
automatically started.
The lambda that is called when the value is updated. The lambda should be used to assign the value on the u
The starting value of the property.
The ending value of the property.
Optionalduration: numberThe animation duration in seconds. Defaults to 1 seconds.
OptionaleasingCurve: Const<EasingCurve>The easing curve to be used. Defaults to
Optionalrepeating: number | booleanWhether 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.
The created animation.
Creates an animation that takes delay seconds to execute.
The delay in seconds.
The created animation.
Calculates the actual size of the layout, when it would be placed in the specified area.
The available area to for the layout.
The actual size of the layout when placed in the area.
Calculates the actual size of the layout, when it would be placed in the specified area.
The available area to for the layout.
The actual size of the layout when placed in the area.
Converts the originLocalPosition from the originElement to this element.
Converts the originLocalPosition from the originElement to this element.
Returns non-clipped bounds of the UI element. Relative to a parent UI panel.
OptionalrelativeTo: UIElementBaseParent 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.
Return the child element at the specified index.
The index of the child element.
Return the child element's index.
Inserts a UI element before the element at the specified index.
The index where to insert the element.
The new element to insert.
Adds a new flexible space as a child of this layout. Flexible space expands to fill all available space in the layout. is inserted before the element at the specified index.
Newly created flexible space.
Adds a new horizontal layout as a child of this layout. Layout is inserted before the element at the specified index.
Index to insert the layout at. This must be in range [0, GetNumChildren()).
Rest...options: UIOption[]Options that allow you to control how is the layout positioned and sized.
Newly created horizontal layout.
Adds a new UI panel as a child of this layout. Panel is inserted before the element at the specified index.
Index to insert the panel at. This must be in range [0, GetNumChildren()).
Rest...options: UIOption[]Options that allow you to control how is the panel positioned and sized.
Newly created UI panel.
Adds a new UI panel as a child of this layout. Panel is inserted before the element at the specified index.
Index at which to insert the panel.
Optionaldepth: numberDepth at which to position the panel. Panels with lower depth will be displayed in front of panels with higher depth. Provided depth is relative to the depth of the parent UI panel. The depth value will be clamped if outside of the depth range of the parent UI panel.
OptionaldepthRangeMin: numberSmallest depth offset allowed by any child UI panels. If a child panel has a depth offset lower than this value it will be clamped.
OptionaldepthRangeMax: numberLargest depth offset allowed by any child UI panels. If a child panel has a depth offset higher than this value it will be clamped.
Rest...options: UIOption[]Options that allow you to control how is the panel positioned and sized.
Newly created UI panel.
Adds a new fixed space object. Fixed space inserts a blank space with specific width or height (depending on layout type) in the layout. Space is inserted after all existing elements.
Index at which to insert the space.
Size of the space in pixels. This will represent either width or height depending whether the layout is vertical or horizontal.
Newly created fixed space.
Adds a new vertical layout as a child of this layout. Layout is inserted before the element at the specified index.
Index to insert the layout at. This must be in range [0, GetNumChildren()).
Rest...options: UIOption[]Options that allow you to control how is the layout positioned and sized.
Newly created vertical layout.
Determines if the specified element is a child of this. If recursive is set, the method searches through the hierarchy
to see if element is a nested child.
Removes the specified element from the layout.
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.
Sets element height in pixels. 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.
If scalable is set to true, the minimum and maximum heights 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.
OptionalminHeight: numberOptionalmaxHeight: numberOptionalscalable: booleanSets element width in pixels. 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.
If scalable is set to true, the minimum and maximum widths 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.
OptionalminWidth: numberOptionalmaxWidth: numberOptionalscalable: booleanScales a point value by using the element's DPI scale to the current pixel value.
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.
The value in pixels.
Converts a pixel value to points by using the element's DPI scale.
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.
The value in points.
StaticrenderRenders a UI element into a texture.
The UI element to be drawn to a texture.
The UI skin to be used to render the element.
The size of the UI texture to draw.
OptionalscalingFactor: numberThe DPI scaling factor of the RenderTarget. Can be used to linearly scale the entire UI, including text.
OptionalclearColor: Immutable<SRGBColor>The clear color. (Default: [0, 0, 0, 0])
An async operation that returns the rendered texture once rendering has been completed by the GPU.
ReadonlyonEvent fired whenever the UI element size changes from a layout update.
ReadonlyonEvent 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.
ReadonlyonEvent fired whenever the UI element is registered with or unregistered from a surface.
Represents a layout that will layout its child elements in a fixed grid.