It looks like you're new here. If you want to get involved, click one of these buttons!
--create new object local flipview = FlipPageView.new() --add some paths flipview:addPages{"gfx/page1.png", "gfx/page2.png", "gfx/page3.png", "gfx/page4.png", "gfx/page5.png", "gfx/page6.png"} --add to stage stage:addChild(flipview) --show flipview:show() |
Likes: atilim, chipster123, Zoyt
Comments
thanks
You can also set the page turn to happen automatically by clicking an arrow outside of your page so that the objects on your page are all interactive. Hope you get the idea.
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
As for the page turning effect, I had ever tried to create page turning ebooks for kids by Codebox and turning page software.
Because Flipview is accepting your pages as one full object. Every image is one page. So every object that you will put on stage will be seen on all pages.
Changes that should be done (My point of view of course:)
1-After on every page roll you should be able to query your page number.
2-According to page number you can add objects(sprites) to stage or remove where not wanted
A more complicated approach will be adding the objects in the creation of the pages i mean while initializing the FlipPageView object and code built-in interractions in some other library with a keyword like;
interraction1= {object="bird.png", pagenumber="1", interractiontype="movable" }
then send this table to init of flipview.
I am giving image1.png as 320 x 480 and image1@1.5x.png as 480x800 with a scaling factor of 1.5.
Unfortunately flippageview lua is not showing the scaled version.
Any idea? Have any of you here tried this code with auto screen scaling property of Gideros?
Thanks again @hnim for sharing this great code with us.
i make a group of 720x480 images, add suffix @2x with scale factor 2.0. then i run project on iphone retina resolution, bigger images were shown.
(sr for my english )
Likes: phongtt, talis
Autamatic Screen scaling is taking logical dimension values from project properties as a base.
What i mean if you set your logical dimensions to 320x400. You should have to calculate your scaling factor according to 320x400 always:D
Actually this is also written in documentation so don't be lazy like me and read it good:D
Take care all.
Thanks!
If you are looking for interactions, you can easilly alter the main code add some event listeners and that's it. Hope you will figure it out.
about events and how to handle them.
Then try to experiment with them by altering the source code of the examples. Because the code that you are trying to alter has some advanced material inside. But do not afraid because the logic stays the same with the simplest example in built-in samples that comes with the Gideros itself.
When you encounter an error in your code or can not find how to solve it directly write to the forum and you will surely get help soon.
For the beginning i strongly advice samples and also http://appcodingeasy.com/Gideros-Mobile
In addition do not forget to check the tutorials and FAQ page.
i have a question.comic book with page curl effect app decrease in performance.Because i added a few pages.How can i increase performance.
I am sure it will increase your performance issues.
In some cases the page can be pulled up/across further than it should be. I've made a fix for you that should fix this problem:
function FlipPageView:onMouseMove(event)
if self.flip and not self.isFlipping then
-- page pulled off edge problem fixed by SinisterSoft
local fixX=event.x
local fixY=event.y
local oppositeY=self.height-fixY
local distance=math.sqrt(fixX*fixX+oppositeY*oppositeY)
if distance>self.width then
distance=self.width
local angle=math.atan(oppositeY/fixX)
fixX=math.cos(angle)*distance
oppositeY=math.sin(angle)*distance
fixY=self.height-oppositeY
end
local dx = fixX - self.oldX
local dy = fixY - self.oldY
self.xTouch = self.xTouch - dx
self.yTouch = self.yTouch - dy
self:roll()
self.oldX = fixX
self.oldY = fixY
end
end
https://deluxepixel.com
https://deluxepixel.com
Likes: SinisterSoft
Likes: oleg