Lua
natiny.input.get_touch_x(touch) -> x
Returns the touch position on the x axis in the window's current drawing units.
Parameters
Returns
| Type |
Description |
number |
Position in drawing units from the window's left edge, or 0 for an invalid identifier |
Example
Lua
for index = 0, natiny.input.get_touch_count() - 1 do
local touch = natiny.input.get_touch_at(index)
natiny.render.circle(natiny.input.get_touch_x(touch),
natiny.input.get_touch_y(touch), 24)
end
Notes
- Touch input is available on Android and in touch-enabled browsers.