Hello,
I know I am resuming a trite and already discussed problem, but the solutions I found didn’t work in my case or I didn’t manage to apply them properly. So please help clarify this issue.
It’s about this object that serves as button:
-
If touch begins and ends on it everything is good.
-
If touch starts on it and finger is moved off of it end phase never gets triggered.
-
If touch is moved and lands on another touch object this latter only receives the end phase.
Here’s the code:
local function plusAll(event) if event.phase == "began" then beganTime = event.time plusAllButton.alpha = .5 elseif event.phase == "ended" then endedTime = event.time plusAllButton.alpha=1 if (endedTime - beganTime) \< 800 then -- does stuff else -- does other stuff end end return true end
I tried adding and removing focus respectively on begin and end phases but if touch is dragged off button focus gets never released (as no ended phase is dispatched)
I tried adding a moved phase and focus is released but still and end phase is being dispatched to an eventual other button that receives the final touch.
How to solve this thing???
Thanks.