allowing touch event to work on iOS and Android

This commit is contained in:
FraKtus 2017-06-04 11:20:25 +02:00
parent 6ac034c803
commit 3debbd2104
1 changed files with 2 additions and 0 deletions

View File

@ -319,6 +319,8 @@ nk_sfml_handle_event(sf::Event* evt)
} else if(evt->type == sf::Event::TouchBegan || evt->type == sf::Event::TouchEnded) {
int down = evt->type == sf::Event::TouchBegan;
const int x = evt->touch.x, y = evt->touch.y;
ctx->input.mouse.pos.x = x;
ctx->input.mouse.pos.y = y;
nk_input_button(ctx, NK_BUTTON_LEFT, x, y, down);
return 1;
} else if(evt->type == sf::Event::TouchMoved) {