Hi all,
I have problem now, which is making 2 scene able to slide left and right. It just cant work, I have absolutely no idea what is going on.
First Scene.lua:
local function onPageSwipe( self, event ) local phase = event.phase if phase == "began" then display.getCurrentStage():setFocus( self ) self.isFocus = true elseif self.isFocus then if phase == "ended" or phase == "cancelled" then local distance = event.x - event.xStart if distance \> swipeThresh then -- SWIPED to right; go back to title page scene composer.gotoScene( "Screen2", "slideRight", 800 ) else end display.getCurrentStage():setFocus( nil ) self.isFocus = nil end end return true end
Second Scene.lua
local function onPageSwipe( self, event ) local phase = event.phase if phase == "began" then display.getCurrentStage():setFocus( self ) self.isFocus = true elseif self.isFocus then if phase == "ended" or phase == "cancelled" then local distance = event.x - event.xStart if distance \> swipeThresh then -- SWIPED to right; go back to title page scene composer.gotoScene( "Screen1", "slideRight", 800 ) else end display.getCurrentStage():setFocus( nil ) self.isFocus = nil end end return true end
What should I edit so that I am able to swipe left and right and able to see both scene?
The code works, but I am only able to swipe from left to right and not both ways(Left to right,right to left)
Thank You