Hi everyone ,
I have 2 questions regarding “Page Curl” in this great tutorial by Jonathan Beebe :
http://blog.anscamobile.com/2011/12/how-to-create-a-page-curl-in-corona/
1st Question : – As you will see in the code below – I made 4 pages with this page curl feature and I registed the 2nd and 3rd pages to swipe function (event) which makes the pages curl when I swipe over them .
========================================
[code]local function swipe(event)
local currentPage = event.target
if event.phase == “moved” then
if event.xStart > event.x then
gotoNext (currentPage, curlPage, 1000)
elseif event.x > event.xStart then
gotoPrevious(curlPage,1000)
end
end
return true
end
page1:addEventListener( “touch” , function() gotoNext( page1,curlPage,1000 ) return true end )
page2:addEventListener( “touch” , swipe )
page3:addEventListener( “touch” , swipe )
page4:addEventListener( “touch” , function() gotoPrevious(curlPage,1000) return true end )[/code]
========================================
- The code before swipe function is same to the one in this tutorial except that I have 4 pages -
Every things go right when I go from the 1st to 2nd and go back to 1st , and same thing when I go from 2nd to 3rd page and go back to 2nd , and same thing with the 3rd and 4th pages .
The problem is that when I reach the 4th page and try to go back to the 2nd page throught the 3rd page , the curl page works fine but the 3rd page stuck and doesn’t move . And same thing when I reach the 3rd page and try to go back to the 1st page throught the 2nd page , the curl page works fine but the 2nd page stuck and doesn’t move .
Obviously that when the 2nd and 3rd pages call the function gotoNext () which is found in the function swipe (event). After , they no longer call the function gotoPrevious () which is found in function swipe (event) as well .
***************************
2nd Question : What sould I do to make the curl page and other pages curl from left to right to make like an Arabic book – who read and write from right to left – ?
Sorry for my huge post and questions
[import]uid: 95767 topic_id: 20435 reply_id: 320435[/import]
[import]uid: 95767 topic_id: 20435 reply_id: 81056[/import]