Inherited: NativeBehaviour


The Widget class serves as the base class for all user interface objects, providing basic functionality for handling updates, drawing, and interaction. Internal methods are marked as internal and are intended for use within the framework rather than by external code.

Public Methods


boundChanged (const Vector2 & size)


isVisible () const


lower ()

Widget *

parentWidget ()


raise ()

RectTransform *

rectTransform () const

Static Methods

Widget *

focusWidget ()

Methods Description

void Widget::boundChanged (Vector2 & size)

Callback to respond to changes in the widget’s size.

:ref:`Widget<api_Widget>`* Widget::focusWidget ()

Returns the application widget that has the keyboard input focus, or nullptr if no widget in this application has the focus.

bool Widget::isVisible () const

Returns true if widget is visible on the screen; otherwise, false.

void Widget::lower ()

Lowers the widget to the bottom of the widget’s stack.

See also raise().

:ref:`Widget<api_Widget>`* Widget::parentWidget ()

Returns the parent Widget.

void Widget::raise ()

Raises this widget to the top of the widget’s stack.

See also lower().

:ref:`RectTransform<api_RectTransform>`* Widget::rectTransform () const

Returns RectTransform component attached to parent Actor.