Skip to content

events

paint

paint()


game_event

game_event(event: game_event_t)

Name Type Description
event game_event_t Game event

override_view

override_view(view_setup: view_setup_t)

Name Type Description
view_setup view_setup_t View setup

console_input

console_input(cmd: string)

Name Type Description
cmd string Console command

This event is called fired when user presses enter in console.
First argument is the command that was entered.

Example

1
2
3
4
5
6
register_callback('console_input', function(cmd)
    print("user typed:", cmd)
    if cmd == 'quit' then
        return false -- prevents quit
    end
end)

Return value of the function

You can interrupt the in-game command execution by returning false from the function. So basically if you return false, the command will not be executed by the game.


unload

unload()