Lua
natiny.input.get_touch_y(touch) -> y
Returns the touch position on the y axis in the window's current drawing units.
Parameters
Returns
| Type |
Description |
number |
Position in drawing units from the window's top 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
- The value uses the window's scale mode, not
physical pixels. It uses the same coordinate system as
natiny.input.get_mouse_y and 2D drawing calls.
- The value remains fixed for the current frame. Movement during a frame is
visible in the next frame.
- See also
natiny.input.get_touch_y_speed.
- Touch input is available on Android and in touch-enabled browsers.