local button = require "in.button"
function init(self)
button.register("button", function() print("Press") end)
end
function final(self)
button.unregister("button")
end
function on_input(self, action_id, action)
button.on_input(action_id, action)
end
This gives me an error, and by debugging it you can see even though it should set the node to nil the lookup doesn't work.
ERROR:SCRIPT: /utils/button.lua:81: Node used in the wrong scene
stack traceback:
[C]: in function 'is_enabled'
/utils/button.lua:81: in function 'is_enabled'
/utils/button.lua:101: in function 'on_input'
However
local button = require "in.button"
function init(self)
self.button = gui.get_node("button")
button.register(self.button, function() print("Press") end)
end
function final(self)
button.unregister(self.button)
end
function on_input(self, action_id, action)
button.on_input(action_id, action)
end
This gives me an error, and by debugging it you can see even though it should set the node to nil the lookup doesn't work.
However
Gives no error