natiny.input.get_touch_released

Lua
natiny.input.get_touch_released(touch) -> released

Returns true only on the frame when the specified touch leaves the screen or is cancelled by the platform.

Parameters

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

Returns

Type Description
boolean true on the touch's release frame; false on other frames or for an invalid identifier

Example

Lua
for i = 0, natiny.input.get_touch_count() - 1 do
    local touch = natiny.input.get_touch_at(i)
    if natiny.input.get_touch_released(touch) then
        drop(natiny.input.get_touch_x(touch), natiny.input.get_touch_y(touch))
    end
end

Notes

  • Platform cancellation, such as the system taking over a gesture, is reported as a release.
  • Touch input is available on Android and in touch-enabled browsers.