natiny_input_get_touch_released

C
bool natiny_input_get_touch_released(uint32_t touch);

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

Parameters

Name Type Description
touch uint32_t Touch identifier from natiny_input_get_touch_at

Returns

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

Example

C
for (int i = 0; i < natiny_input_get_touch_count(); i++) {
    uint32_t touch = natiny_input_get_touch_at(i);
    if (natiny_input_get_touch_released(touch))
        drop(natiny_input_get_touch_x(touch), natiny_input_get_touch_y(touch));
}

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.