I've got a turn-based game that listens for one input per turn. In a system like that, you have to suppress repeated input from a button being held down, or else it'll zoom through several turns on a single button click.
BUTTON() has the nice feature that lets you specify if you're interested in just the moment when the button is down (etc.) so it's easy to get only one input at a time using, for example, BUTTON(2).
No options like that are implemented for TOUCH, so to have a button-like interface on the touch screen, here's what I came up with. It works, but I'm wondering if there's a better, more typical, or more 'preferred' way. This would be at the start of each turn:
@TDOWN TOUCH OUT TM,TX,TY IF TM==0 GOTO @TDOWN @TUP TOUCH OUT TM,NotUsed,Ignored IF TM GOTO @TUP '(…code that branches based on X,Y data)First it waits for the screen to be touched, and grabs the X,Y data when it is; then it waits for the touch to be lifted, but ignores that X,Y data (you can't just omit the variables, it turns out). It works, but I feel like there's a probably a standard way to handle this kind of thing, and I thought maybe those of you with more experience with this kind of interface might know what that is. Thanks!