Hi ,
What is the best way to query Multitouch coordinates, absolute and relative ?
I had a look in the documentation but I can only see GetMousePosition () . Is it applicable for touch events ?
Thanks in advance,
Alex
Hi ,
What is the best way to query Multitouch coordinates, absolute and relative ?
I had a look in the documentation but I can only see GetMousePosition () . Is it applicable for touch events ?
Thanks in advance,
Alex
You would do something like…
for(int i = 0; i < input.GetNumTouches(); i++)
{
TouchState* ts = input.GetTouch(i);
}
urho3d.github.io/documentation/H … input.html
urho3d.github.io/documentation/H … state.html
Thanks a lot
Just one thing can we get both relative and absolute position ?
It looks like they are both available in TouchState (absolute: position_ / lastPosition_, relative: delta_).
thanks it works quite well
Just one thing if we want to check for a touch event is that the best way to do it :
[code]bool touchEvent = false;
if(input->GetNumTouches()>0)
{
touchEvent = true ;
}[/code]
I wonder if there is something similar to SDL:
if (evt.type == SDL_FINGERDOWN) {
SDL_Touch *state = SDL_GetTouch(evt.tfinger.touchId);
}
That way works, but if you want another method you can subscribe to the touch events:
TouchBegin
TouchMove
TouchEnd
eg:
[code]SubscribeToEvent(“TouchBegin”, “Handle_TouchBegin”);
}
void Handle_TouchBegin(StringHash eventType, VariantMap& eventData)
{
log.Info(“TouchBegin”);
}[/code]
Awesome works like a charm