local onscreen = require "in.onscreen"
local post_to_listener
local function on_analog(action, control, touch)
if action == onscreen.ANALOG_PRESSED then
print("analog pressed")
post_to_listener("analog", { x = 0, y = 0, pressed = true })
elseif action == onscreen.ANALOG_RELEASED then
print("analog released")
post_to_listener("analog", { x = 0, y = 0, released = true })
elseif action == onscreen.ANALOG_MOVED then
print("analog moved")
post_to_listener("analog", { x = touch.x, y = touch.y })
end
end
local function on_control_a(action, control, touch)
if action == onscreen.BUTTON_PRESSED then
post_to_listener("button_a", { pressed = true })
This file has been truncated. show original