natiny.input.get_touch_down

Lua
natiny.input.get_touch_down(touch) -> down

Returns whether the specified touch is currently in contact with the screen.

Parameters

Name Type Description
touch number Touch identifier from natiny.input.get_touch_at

Returns

Type Description
boolean true while the touch is in contact with the screen; false on its release frame or for an invalid identifier

Example

Lua
if drag and natiny.input.get_touch_down(drag) then
    camera_x = camera_x - natiny.input.get_touch_x_speed(drag)
end

Notes

  • Touch input is available on Android and in touch-enabled browsers.