> For the complete documentation index, see [llms.txt](https://zarzel.gitbook.io/zarscript2/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zarzel.gitbook.io/zarscript2/documentation/api-libs/render/gui-events.md).

# GUI Events

List of events that will be called on the shown GUI

### on\_render\_screen

This event will be called when the GUI screen is being rendered

| Key      | Type   | Description         |
| -------- | ------ | ------------------- |
| mouse\_x | Number | X Mouse coordinates |
| mouse\_y | Number | Y Mouse coordinates |

### on\_click

This event will be called when a mouse button is pressed in the GUI

| Key           | Type   | Description                    |
| ------------- | ------ | ------------------------------ |
| mouse\_x      | Number | X Mouse coordinates            |
| mouse\_y      | Number | Y Mouse coordinates            |
| mouse\_button | Number | ID of the mouse button clicked |

### on\_drag\_click

This event will be called when the mouse is being hold and dragged around

| Key           | Type   | Description                             |
| ------------- | ------ | --------------------------------------- |
| mouse\_x      | Number | X Mouse coordinates                     |
| mouse\_y      | Number | Y Mouse coordinates                     |
| mouse\_button | Number | ID of the mouse button clicked          |
| time\_since   | Number | Time since the mouse click has happened |

### on\_mouse\_released

This event will be called when a mouse button is released

### on\_key\_typed

This event will be called when a key is pressed on the keyboard

| Key         | Type      | Description             |
| ----------- | --------- | ----------------------- |
| typed\_char | Character | Character pressed       |
| key\_code   | Number    | Code of the pressed key |

### on\_gui\_close

This event will be called when the GUI is closed
