Panel

class Panel

A container for user interface elements. See Canvas.add_panel().

rect_transform

The rect transform for the panel.

Attribute:

Read-only, cannot be set

Return type:

RectTransform

visible

Whether the UI object is visible.

Attribute:

Can be read or written

Return type:

bool

add_panel([visible = True])

Create a panel within this panel.

Parameters:

visible (bool) – Whether the new panel is visible.

Return type:

Panel

add_text(content[, visible = True])

Add text to the panel.

Parameters:
  • content (str) – The text.

  • visible (bool) – Whether the text is visible.

Return type:

Text

add_input_field([visible = True])

Add an input field to the panel.

Parameters:

visible (bool) – Whether the input field is visible.

Return type:

InputField

add_button(content[, visible = True])

Add a button to the panel.

Parameters:
  • content (str) – The label for the button.

  • visible (bool) – Whether the button is visible.

Return type:

Button

remove()

Remove the UI object.