Hey everyone,
I’m writing an app that has multiple scenes (inventory, main etc.) created with composer and I want to add a swipe listener to navigate between them. For now I have a Runtime touch listener as it can be seen here –
local function swipe\_scene(event) if event.phase == "ended" then if (event.xStart \< event.x and (event.x - event.xStart) \>= 100 and current\_scene\_no \> 1) then local options = { effect = "slideRight", time = 500 }; current\_scene\_no = current\_scene\_no - 1; composer.gotoScene(scene\_list[current\_scene\_no], options); elseif (event.xStart \> event.x and (event.xStart - event.x) \>= 100 and current\_scene\_no \< scene\_list.count) then local options = { effect = "slideLeft", time = 500 }; current\_scene\_no = current\_scene\_no + 1; composer.gotoScene(scene\_list[current\_scene\_no], options); end end return true; end Runtime:addEventListener("touch", swipe\_scene);
but this does not look good since it doesn’t show the new scene while swiping, but switches to it only after swipe is completed (There is no need for it to be a swipe as well since it only checks the x and xStart coordinates) Is there any way to accomplish what I want with scenes or are scenes aren’t suitable for this?
Thanks in advance!