The touch
control can be used for receiving multi-touch events.
<touch text="touch here!" ontouchabs="moved" />
actions.moved = function (id, x, y)
print("touch point " .. id .. " at " .. x .. " " .. y);
end
Set the ID for this control so that it can be updated later. See layout library.
<touch id="my_touch" />
Set the visibility state using visible
or invisible
or gone
.
<touch visibility="gone" />
Set the text to be shown in the background.
<touch text="hello world" />
Set the background image.
<touch image="bg.png" />
See the styling page for more details.
Occurs when the touch area is tapped.
<touch ontap="tapped" />
actions.tapped = function ()
...
end
Occurs when the touch area is held down.
<touch onhold="held" />
actions.held = function ()
...
end
Occurs when the touch area is double tapped.
<touch ondoubletap="double" />
actions.double = function ()
...
end
Occurs when touch begins.
<touch ondown="down" />
actions.down = function ()
...
end
Occurs when touch ends.
<touch onup="up" />
actions.up = function ()
...
end
Occurs when the touch area changes size.
<touch ontouchsize="touch_size" />
actions.touch_size = function (w, h, oldw, oldh)
...
end
Occurs when a multi-touch event starts (id is the pointer id).
<touch ontouchstart="touch_start" />
actions.touch_start = function (id, x, y)
...
end
Occurs on multi-touch movement (id is the pointer id).
<touch ontouchdelta="touch_delta" />
actions.touch_delta = function (id, deltax, deltay)
...
end
Occurs on multi-touch movement (id is the pointer id).
<touch ontouchabs="touch_abs" />
actions.touch_abs = function (id, absx, absy)
...
end
Occurs when a multi-touch event ends (id is the pointer id).
<touch ontouchend="touch_end" />
actions.touch_end = function (id, x, y)
...
end
Occurs on a multi-touch tap occurs with n fingers.
<touch onmultitap="multitap" />
actions.multitap = function (n)
...
end