Skip to content
Gothic MultiplayerMultiplayer
Gothic MP Wiki

MenuButton

A button added to the ESC menu by a script.

since 0.1.30-alpha

ESC menu buttons are created with addMenuButton. In the examples button is any MenuButton.

Methods

setText

since 0.1.30-alpha
button:setText(text)

Changes the text of the button (an open ESC menu shows it at once).

ParameterTypeDescription
textstringNew text.

Returns: boolean - false when the button was removed.

setEnabled

since 0.1.30-alpha
button:setEnabled(enabled)

Enables or greys out the button.

ParameterTypeDescription
enabledbooleanfalse = greyed out, cannot be clicked.

Returns: boolean - false when the button was removed.

setVisible

since 0.1.30-alpha
button:setVisible(visible)

Shows or hides the button.

ParameterTypeDescription
visibleboolean

Returns: boolean - false when the button was removed.

remove

since 0.1.30-alpha
button:remove()

Removes the button from the ESC menu.

Returns: boolean - false when it was already removed.

isValid

since 0.1.30-alpha
button:isValid()

Tells whether the button still exists.

Returns: boolean