driver.love/0001-on

32 lines
1.5 KiB
Plaintext

on = {
-- for top-level handlers (see https://love2d.org/wiki/Main_Page for love.* variants)
-- supported handlers:
-- on.initialize (see love.load)
-- One major note:
-- driver.love gives you zero control over the order definitions are
-- loaded in. To avoid issues, never initialize one global based on the
-- value of another. Perform such initializations inside a function like
-- on.initialize.
-- on.quit
-- on.code_change (runs after executing code received from the driver)
-- on.code_submit (runs after submitting code to the app; only applicable to the driver, obviously)
-- on.draw (avoid modifying global state here)
-- on.update
-- on.resize
-- on.file_drop (see love.filedropped)
-- on.focus
-- on.mouse_press (see love.mousepressed)
-- on.mouse_release (see love.mousereleased)
-- on.mouse_move (see love.mousemoved)
-- on.mouse_wheel_move (see love.wheelmoved)
-- on.keychord_press (see keychord.lua in this repo)
-- on.text_input (see love.textinput)
-- on.key_release (see love.keyreleased)
-- on.load_settings(settings) -- fan out settings table into any other global state
-- settings might be nil if there are no saved settings
-- runs before on.initialize
-- on.save_settings() -- return a settings table which will be persisted to disk across restart
-- runs after on.quit
}