Canvas

class Canvas

A canvas for user interface elements. See stock_canvas() and add_canvas().

RectTransform rect_transform()

The rect transform for the canvas.

bool visible()
void set_visible(bool value)

Whether the UI object is visible.

Panel add_panel(bool visible = true)

Create a new container for user interface elements.

Parameters:
  • visible – Whether the panel is visible.

Text add_text(std::string content, bool visible = true)

Add text to the canvas.

Parameters:
  • content – The text.

  • visible – Whether the text is visible.

InputField add_input_field(bool visible = true)

Add an input field to the canvas.

Parameters:
  • visible – Whether the input field is visible.

Button add_button(std::string content, bool visible = true)

Add a button to the canvas.

Parameters:
  • content – The label for the button.

  • visible – Whether the button is visible.

void remove()

Remove the UI object.