a new event: receiving code changes from the driver

This commit is contained in:
Kartik K. Agaram 2022-12-16 19:35:29 -08:00
parent 25b1fb8cc5
commit 6a5eca342c
2 changed files with 2 additions and 0 deletions

View File

@ -4,6 +4,7 @@ on = {
-- supported handlers:
-- on.initialize (see love.load)
-- on.quit
-- on.code_changed (runs after every time the driver sends a new definition)
-- on.draw
-- on.update
-- on.resize

View File

@ -148,6 +148,7 @@ function live.update(dt)
local buf = live.receive()
if buf then
live.run(buf)
if on.code_changed then on.code_changed() end
end
Live.Previous_read = Current_time
end