The base class for all UI widgets. Provides layout, input handling, and child management.
Lua full name: lysa.ui.Widget
|
| boolean | is_enabled () |
| | Returns true if the widget responds to mouse and keyboard input. More...
|
| |
| nil | set_pos (x: number, y: number) |
| | Moves the widget to the given position in its parent's coordinate space. More...
|
| |
| nil | set_size (width: number, height: number) |
| | Resizes the widget to the given width and height in virtual screen units. More...
|
| |
| nil | set_rect (x: number, y: number, width: number, height: number) |
| | Sets the widget's position and size in one call. More...
|
| |
| nil | remove (child: Widget) |
| | Removes and detaches the given direct child widget. More...
|
| |
| nil | remove_all () |
| | Removes and detaches all descendant widgets recursively. More...
|
| |
| nil | refresh () |
| | Forces a full redraw of the widget on the next frame. More...
|
| |
| nil | resize_children () |
| | Triggers a layout pass that repositions and resizes all direct children according to their alignment. More...
|
| |
| Widget | set_focus (focus: boolean|nil) |
| | Requests keyboard focus for this widget (pass nil or true to acquire, false to release). Returns the widget itself. More...
|
| |
| nil | set_children_offset (x: number, y: number) |
| | Sets the scroll offset applied to children during layout, enabling scrollable content. More...
|
| |
| Text | create_text (alignment: Alignment, text: string) |
| | Creates and adds a Text child widget with the given alignment and initial text. More...
|
| |
| Text | create_text (resource: string, alignment: Alignment, text: string) |
| | Creates and adds a Text child widget, loading its style from a resource string. More...
|
| |
| Panel | create_panel (alignment: Alignment) |
| | Creates and adds a Panel child widget with the given alignment. More...
|
| |
| Panel | create_panel (resource: string, alignment: Alignment) |
| | Creates and adds a Panel child widget, loading its style from a resource string. More...
|
| |
| Box | create_box (alignment: Alignment) |
| | Creates and adds a Box child widget with the given alignment. More...
|
| |
| Box | create_box (resource: string, alignment: Alignment) |
| | Creates and adds a Box child widget, loading its style from a resource string. More...
|
| |
| Button | create_button (alignment: Alignment) |
| | Creates and adds a Button child widget with the given alignment. More...
|
| |
| Button | create_button (resource: string, alignment: Alignment) |
| | Creates and adds a Button child widget, loading its style from a resource string. More...
|
| |
| ToggleButton | create_toggle_button (alignment: Alignment) |
| | Creates and adds a ToggleButton child widget with the given alignment. More...
|
| |
| ToggleButton | create_toggle_button (resource: string, alignment: Alignment) |
| | Creates and adds a ToggleButton child widget, loading its style from a resource string. More...
|
| |
| HLine | create_hline (alignment: Alignment) |
| | Creates and adds a horizontal Line child widget with the given alignment. More...
|
| |
| HLine | create_hline (resource: string, alignment: Alignment) |
| | Creates and adds a horizontal Line child widget, loading its style from a resource string. More...
|
| |
| VLine | create_vline (alignment: Alignment) |
| | Creates and adds a vertical Line child widget with the given alignment. More...
|
| |
| VLine | create_vline (resource: string, alignment: Alignment) |
| | Creates and adds a vertical Line child widget, loading its style from a resource string. More...
|
| |
| Frame | create_frame (alignment: Alignment, title: string) |
| | Creates and adds a Frame child widget with the given alignment and title. More...
|
| |
| Frame | create_frame (resource: string, alignment: Alignment, title: string) |
| | Creates and adds a Frame child widget, loading its style from a resource string. More...
|
| |
| TextEdit | create_text_edit (alignment: Alignment, text: string|nil) |
| | Creates and adds a TextEdit child widget with the given alignment and optional initial text. More...
|
| |
| TextEdit | create_text_edit (resource: string, alignment: Alignment, text: string|nil) |
| | Creates and adds a TextEdit child widget, loading its style from a resource string. More...
|
| |
| Image | create_image (alignment: Alignment) |
| | Creates and adds an Image child widget with the given alignment. More...
|
| |
| Image | create_image (resource: string, alignment: Alignment) |
| | Creates and adds an Image child widget, loading its style from a resource string. More...
|
| |
| Image | create_image (resource: string, alignment: Alignment, autoresize: boolean, fixedsize: boolean) |
| | Creates and adds an Image child widget with auto-resize and fixed-size options. More...
|
| |
| VScrollBar | create_vscrollbar (alignment: Alignment) |
| | Creates and adds a vertical ScrollBar child widget with the given alignment. More...
|
| |
| VScrollBar | create_vscrollbar (resource: string, alignment: Alignment) |
| | Creates and adds a vertical ScrollBar child widget, loading its style from a resource string. More...
|
| |
| HScrollBar | create_hscrollbar (alignment: Alignment) |
| | Creates and adds a horizontal ScrollBar child widget with the given alignment. More...
|
| |
| HScrollBar | create_hscrollbar (resource: string, alignment: Alignment) |
| | Creates and adds a horizontal ScrollBar child widget, loading its style from a resource string. More...
|
| |
| TreeView | create_tree_view (alignment: Alignment) |
| | Creates and adds a TreeView child widget with the given alignment. More...
|
| |
| TreeView | create_tree_view (resource: string, alignment: Alignment) |
| | Creates and adds a TreeView child widget, loading its style from a resource string. More...
|
| |
| Widget | create_widget (alignment: Alignment) |
| | Creates and adds a transparent container Widget child with the given alignment. More...
|
| |
| Widget | create_widget (resource: string, alignment: Alignment) |
| | Creates and adds a transparent container Widget child, loading its style from a resource string. More...
|
| |
| ListBox | create_list_box (alignment: Alignment) |
| | Creates and adds a ListBox child widget with the given alignment. More...
|
| |
| ListBox | create_list_box (resource: string, alignment: Alignment) |
| | Creates and adds a ListBox child widget, loading its style from a resource string. More...
|
| |
| ProgressBar | create_progress_bar (alignment: Alignment) |
| | Creates and adds a ProgressBar child widget with the given alignment. More...
|
| |
| ProgressBar | create_progress_bar (resource: string, alignment: Alignment) |
| | Creates and adds a ProgressBar child widget, loading its style from a resource string. More...
|
| |
| VProgressBar | create_vprogress_bar (alignment: Alignment) |
| | Creates and adds a vertical ProgressBar child widget with the given alignment. More...
|
| |
| VProgressBar | create_vprogress_bar (resource: string, alignment: Alignment) |
| | Creates and adds a vertical ProgressBar child widget, loading its style from a resource string. More...
|
| |
| HProgressBar | create_hprogress_bar (alignment: Alignment) |
| | Creates and adds a horizontal ProgressBar child widget with the given alignment. More...
|
| |
| HProgressBar | create_hprogress_bar (resource: string, alignment: Alignment) |
| | Creates and adds a horizontal ProgressBar child widget, loading its style from a resource string. More...
|
| |
| ScrollBox | create_scroll_box (alignment: Alignment) |
| | Creates and adds a ScrollBox child widget with the given alignment. More...
|
| |
| ScrollBox | create_scroll_box (resource: string, alignment: Alignment) |
| | Creates and adds a ScrollBox child widget, loading its style from a resource string. More...
|
| |
| Widget | add_child (child: Widget, alignment: integer, resource: string|nil) |
| | Adds a pre-constructed child widget with the given alignment and optional resource string. More...
|
| |
|
| integer | id |
| | The unique ID
|
| |
| integer | type |
| | The concrete widget type (see lysa.ui.WidgetType). (read-only)
|
| |
| Widget[] | children |
| | Ordered list of direct child widgets.
|
| |
| boolean | visible |
| | True if the widget is visible; false hides it and all its children.
|
| |
| any | user_data |
| | Lua user data.
|
| |
| boolean | enabled |
| | Enables or disables the widget's response to input events (pass nil or true to enable, false to disable).
|
| |
| number | width |
| | The widget width in virtual screen units.
|
| |
| number | height |
| | The widget height in virtual screen units.
|
| |
| lysa.Rect | rect |
| | The current position and size of the widget as a Rect.
|
| |
| integer | alignment |
| | The current placement alignment within the parent (see lysa.ui.Alignment).
|
| |
| lysa.Font | font |
| | The font used to render text within this widget.
|
| |
| number | font_scale |
| | The scale factor applied to the widget's font.
|
| |
| boolean | focused |
| | True if this widget currently holds keyboard focus. (read-only)
|
| |
| Widget|nil | parent |
| | The direct parent widget, or nil if this is a root widget. (read-only)
|
| |
| number | padding |
| | Spacing in virtual screen units between children during layout.
|
| |
| number | vborder |
| | Vertical inset between the widget edges and its content area.
|
| |
| number | hborder |
| | Horizontal inset between the widget edges and its content area.
|
| |
| boolean | draw_background |
| | False if the widget's background should be drawn transparently.
|
| |
| boolean | pushed |
| | True if the widget is currently in a pressed state (e.g. mouse button held down over it).
|
| |
| boolean | pointed |
| | True if the mouse cursor is currently over this widget. (read-only)
|
| |
| boolean | freezed |
| | True if the widget ignores all input events without being visually disabled.
|
| |
| boolean | overlapping |
| | True if this widget visually overlaps one or more siblings. (read-only)
|
| |
| lysa.Rect | children_rect |
| | The smallest Rect enclosing all direct children. (read-only)
|
| |
| integer | group_index |
| | User-defined integer tag used to identify widgets within a logical group.
|
| |
| number | transparency |
| | Global alpha multiplier for the widget (0.0 = fully transparent, 1.0 = opaque).
|
| |
| boolean | consume_mouse_event |
| | When true, mouse events are consumed by this widget and not propagated to its parent.
|
| |
| number | children_offset_x |
| | Horizontal scroll offset subtracted from child positions during layout (read-only; use set_children_offset to change).
|
| |
| number | children_offset_y |
| | Vertical scroll offset subtracted from child positions during layout (read-only; use set_children_offset to change).
|
| |