SP4CEBAR 2023-08-08 08:24 (Edited)
The performance impact of this system is below 1% (if you turn the demo off)
The generated variables are all global, and their names have "TOUCH_" as a prefix, with the exception of "G_DELTA_TIME" which is a constant equal to 1/60
the touch system generates:
and some other variables are generated along the way:
SUB TOUCH_MANAGER
IF TOUCH THEN
IF TAP THEN
TOUCH_TIMESTAMP = TIMER
TOUCH_INITIAL_X = TOUCH.X
TOUCH_INITIAL_Y = TOUCH.Y
END IF
TOUCH_VX = (TOUCH.X - TOUCH_PREVIOUS_X) * G_DELTA_TIME
TOUCH_VY = (TOUCH.Y - TOUCH_PREVIOUS_Y) * G_DELTA_TIME
TOUCH_PREVIOUS_X = TOUCH.X
TOUCH_PREVIOUS_Y = TOUCH.Y
TOUCH_DURATION = TIMER - TOUCH_TIMESTAMP
TOUCH_RELATIVE_X = TOUCH.X - TOUCH_INITIAL_X
TOUCH_RELATIVE_Y = TOUCH.Y - TOUCH_INITIAL_Y
END IF
RELEASE = (TOUCH_PREVIOUS<>TOUCH) AND NOT TOUCH
TOUCH_PREVIOUS = TOUCH
END SUB