pass remaining love handlers through
Now I have touchpressed and touchreleased working! The stack of these handlers is quite deep at this point: car.* -> on.* -> App.* -> love.* But I feel like I have a good rationale for each of these: love.* - OS App.* - testable on.* - live-editable car.* - the shell
This commit is contained in:
parent
b7345d85fc
commit
77eb05b50b
|
@ -1,4 +1,5 @@
|
|||
on.initialize = function()
|
||||
populate_missing_handlers()
|
||||
love.graphics.setFont(love.graphics.newFont(Font_height))
|
||||
Line_height = math.floor(Font_height*1.3)
|
||||
Line_number_padding = Line_number_width*App.width('m')
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
populate_missing_handlers = function()
|
||||
for handler_name in pairs(love.handlers) do
|
||||
if on[handler_name] == nil then
|
||||
-- make it available to scripts
|
||||
on[handler_name] = function(...)
|
||||
if car[handler_name] then
|
||||
car[handler_name](...)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue