C
int natiny_input_get_touch_x(uint32_t touch);
Returns the touch position on the x axis in the window's current drawing units.
Parameters
Returns
| Type |
Description |
int |
Position in drawing units from the window's left edge, or 0 for an invalid identifier |
Example
C
for (int index = 0; index < natiny_input_get_touch_count(); index++) {
uint32_t touch = natiny_input_get_touch_at(index);
natiny_render_circle((float)natiny_input_get_touch_x(touch),
(float)natiny_input_get_touch_y(touch), 24.0f);
}
Notes
- Touch input is available on Android and in touch-enabled browsers.