natiny_input_get_touch_y

C
int natiny_input_get_touch_y(uint32_t touch);

Returns the touch position on the y axis in the window's current drawing units.

Parameters

Name Type Description
touch uint32_t Touch identifier from natiny_input_get_touch_at

Returns

Type Description
int Position in drawing units from the window's top 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.