Hello again,
I’ve a little problem with Codea. It’s about one time touch and double times click.
Here is a sample code:
function setup()
watch("numberTap")
numberTap = 0
end
function addTap()
numberTap = numberTap + 1
end
function draw()
if CurrentTouch.state == BEGAN
addTap()
end
end
When I tap on the screen the variable numberTap is updated continuously not one time.
I think that the solution is:
if CurrentTouch.state == ClickPressed
addTap()
end
So, I suggest you to add: ClickPressed and ClickReleased.
I hope you understand my problem.
Edit: I do not know how to put this code here: don’t works. You know the codes for this forum?
Mark, don’t works. Please give me an full example about One Simple Click.
Simeon, Your example works fine, but not works fine for One Simple Click and I know why, because function draw is updated every one frame, maybe, Here we need a function that is not automatically updated every frame, only if it interacted with touch event.