Hello,
I am trying to have both gestures in one of my project pages. If user swipes the background, it goes to the following page. If he/she "pinches" to zoom, the group background zooms in/out.
For the swipe, I am using the following code with success:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | local function flip (event) if event.phase =="ended" then if event.xStart < event.x and (event.x - event.xStart) >= 30 then if (curPage > 1) then director:changeScene( "page_"..curPage-1, "moveFromLeft" ) end elseif event.xStart > event.x and (event.xStart-event.x) >= 30 then if (curPage < numPages) then director:changeScene("page_"..curPage+1, "moveFromRight") end end end end layer1:addEventListener("touch", flip) |