I just don’t understand what’s the point of dispatchEvent…what exactly does it do in this function:
local function myTouchFunction(event)
if event.phase == “began” then
elseif event.phase == “moved” then
if e.x < e.target.contentBounds.xMin or
e.x > e.target.contentBounds.xMax or
e.y < e.target.contentBounds.yMin or
e.y > e.target.contentBounds.yMax then
e.phase = “offTarget”
e.target:dispatchEvent(e)
end
– add your moved code here
elseif event.phase == “offTarget” then
elseif event.phase == “ended” then
elseif event.phase == “cancelled” then
end
end
I don’t get it…what does it do? What role does dispatchEvent have in this function?
Which part of this code tracks the touch when it moves over the content bounds?