Class: Panel

Panel()

new Panel()

A UI element that acts as a container for other UI elements, providing a background and border.
Source:

Extends

  • BaseUIElement

Members

children :Array.<BaseUIElement>

Type:
  • Array.<BaseUIElement>
Source:

Methods

(protected) _drawSelf(context, engine)

Specific drawing logic for the Panel and its children. Called by BaseUIElement.render after visibility and context checks.
Parameters:
Name Type Description
context CanvasRenderingContext2D The rendering context.
engine
Source:

Panel(options)

new Panel(options)

Creates an instance of Panel.
Parameters:
Name Type Description
options object Configuration options for the panel.
Properties
Name Type Attributes Default Description
x number <optional>
0 The x-coordinate.
y number <optional>
0 The y-coordinate.
width number <optional>
100 The width of the panel.
height number <optional>
100 The height of the panel.
backgroundColor string <optional>
null Background color (e.g., 'rgba(0,0,0,0.5)'). If null, no background.
borderColor string <optional>
'gray' Border color.
borderWidth number <optional>
0 Width of the border. If 0, no border.
children Array.<BaseUIElement> <optional>
[] Initial child elements.
visible boolean <optional>
true Whether the panel is visible.
enabled boolean <optional>
true Whether the panel is enabled for updates.
id string <optional>
Optional ID.
Source:

Members

children :Array.<BaseUIElement>

Type:
  • Array.<BaseUIElement>
Source:

Methods

(protected) _drawSelf(context, engine)

Specific drawing logic for the Panel and its children. Called by BaseUIElement.render after visibility and context checks.
Parameters:
Name Type Description
context CanvasRenderingContext2D The rendering context.
engine
Source: