| 1234567891011121314151617 |
- function init(self)
- msg.post(".", "acquire_input_focus")
- end
- function on_input(self, action_id, action)
- if action.pressed then
- if gui.pick_node(gui.get_node("add_10000"), action.x or 0, action.y or 0) then
- msg.post("example", "add", { amount = 10000 })
- elseif gui.pick_node(gui.get_node("add_1000"), action.x or 0, action.y or 0) then
- msg.post("example", "add", { amount = 1000 })
- elseif gui.pick_node(gui.get_node("add_100"), action.x or 0, action.y or 0) then
- msg.post("example", "add", { amount = 100 })
- elseif gui.pick_node(gui.get_node("remove_100"), action.x or 0, action.y or 0) then
- msg.post("example", "remove", { amount = 100 })
- end
- end
- end
|