Action.dx and action.dy

I am not sure if this is a bug or not.

I would say that when action.pressed is true, action.dx and action.dy should be 0. Indeed they are 0 on my Mac. But they are not 0 on my Android devide (Huawei P10 lite). Indeed it seems to me that dx and dy are computed using the last coordinates of the previous touch. At least the behavior on different platforms should be consistent.

Ciao!

2 Likes

Yes, there’s a bug with first dx/dy. It is reported here: https://github.com/defold/defold/issues/3728

3 Likes

Thanks! I am sorry I was not aware of the previous report about this…

1 Like

That is perfectly fine! Reminders like these help raise attention to issues that aren’t critical but still annoying and encountered by users in real life situations.

5 Likes

In that case i’d like to point that I coincidentally ran into this bug just yesterday. What a coincidence!

in the end i made some changes and ended up making this (which works on regular action.x and action.y)

4 Likes

Wow, didn’t know it was a bug. I solve this by passing the first event without handling.

The first event - touch began. The second event - get the delta.