Touch state
-
How can I make a button press register after touch has ended? Want to make it register once you lift the finger from the screen.
-
Something like this:
pressed = false state = false buttonPos = { gwidth() / 2, gheight() / 2 } radius = 50 loop clear() printat( 0, 0, pressed ) pressed = buttonPressed() if state and !pressed then playNote( 0, 3, 800, 0.5, 10, 0.5 ) endif circle( buttonPos.x, buttonPos.y , radius, 100, red, false) update() state = pressed repeat function buttonPressed() var result = false var list = touch() for i = 0 to len (list) loop pos = list[i] if distance( pos, buttonPos ) < radius then result = true endif repeat return result
-
Thanks pianofire, your a sanity saver 😂