Open ericoporto opened 6 months ago
Trying to understand how this api works, am I right that this returned array is always as long as the maximal number of touches done during the gameplay (it only grows and never shrinks)?
My big question in regards to API is: why return array, and not have an indexed attribute? I mean something like
builtin struct Touch {
import static TouchPoint* TouchPoints[];
import static int TouchPointsCount; // or TouchCount
};
My big question in regards to API is: why return array, and not have an indexed attribute?
That wasy first sketch of the API, I am not sure which is better.
Currently, each touch point is a position (x,y), if the finger is down or not, and a finger id that is unique.
Now apparently Safari on iPhone currently can only have at maximum 2 touch positions, while on Android Chrome it seems possible to go up to 10. On an Android app it seems, at least on my phone, it goes up to 10 (ignoring the hard limit set in ags in this PR), and in my iPhone I need to test again - I forgot. But I thought about using the max to limit the count to how many touches are actually being used in the application.
I was debating about which way is better, to handle the touch points, for instance, I think I like more the way you mentioned, but I was also thinking about dropping the "is down" property from the touch point and return an array and any items in the array means the finger is down, as I think the position in the touch release may not be relevant.
fix #1538
A minimal touch api that can be used to detect touching a screen.