natiny_input_get_touch_down
bool natiny_input_get_touch_down(uint32_t touch);
Returns whether the specified touch is currently in contact with the screen.
Parameters
| Name | Type | Description |
|---|---|---|
touch |
uint32_t |
Touch identifier from natiny_input_get_touch_at |
Returns
| Type | Description |
|---|---|
bool |
true while the touch is in contact with the screen; false on its release frame or for an invalid identifier |
Example
if (drag && natiny_input_get_touch_down(drag)) {
camera_x -= (float)natiny_input_get_touch_x_speed(drag);
}
Notes
- Touch input is available on Android and in touch-enabled browsers.