Adds a button to the control panel, in the shocks section, that runs the
func function when pressed. This method is aliased by the
@button function decorator, which is simpler to use.
text — str, required
The text to be displayed on the button.
func — func(model), required
The function to be executed when the button is pressed. The function takes one argument, the model object.
desc — str, optional
A long description to display as a tooltip.
Default value: None
Notes and Examples
charwickMar 27, 2020 at 23:02
This example creates a button that zeroes out agents’ gold holdings when pressed.