Canvas

public class Canvas

A canvas for user interface elements. See getStockCanvas() and addCanvas().

RectTransform getRectTransform()

The rect transform for the canvas.

boolean getVisible()
void setVisible(boolean value)

Whether the UI object is visible.

Panel addPanel(boolean visible)

Create a new container for user interface elements.

Parameters:
  • visible (boolean) – Whether the panel is visible.

Text addText(String content, boolean visible)

Add text to the canvas.

Parameters:
  • content (String) – The text.

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

InputField addInputField(boolean visible)

Add an input field to the canvas.

Parameters:
  • visible (boolean) – Whether the input field is visible.

Button addButton(String content, boolean visible)

Add a button to the canvas.

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

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

void remove()

Remove the UI object.