object:scale(x,y) is relative
object.xScale & object.yScale isn’t
in the book class, the function bookLoop() at line 475 sets touch event listeners on the class. i would guess that these are competing with the similar event listeners from MultiTouch.
dmc
Actually It doesn’t if I put rightPage or leftpage in your multitouch function it works if I put a group it doesnt work.
I’m not able to have the whole group zoom.
i tested my library using ordinary Corona display elements like your leftPage and rightPage so those will work.
i checked the BookClass again and saw that the touch listeners are being applied to the left and right pages. you will need to find out which objects get the initial touches - the group or the pages. this can be determined by adding prints inside of the listeners.
at the least, the group will have to get them first if the pinch/zoom is going to work correctly.
FYI: in any touch scenario, it’s unlikely that two different touch libraries are going to work harmoniously together.
dmc
Hello @dmc,
So I got the two libraries working together, dmc_multitouch and bookclass, except for multitouch the touches are only registered on the top left side of the screen and not the entire screen. Anay ideas why this could be happeneing? Using print statements I attempted to debug by checking where the size and location of the object getting the eventlistener in TouchManager:register but still nothing. I know Im asking alot but any help would be greatly appreciated.
Thanks
Hi @dmccuskey how can I make your library work with a group containing multiple images? I have two images side by side and I want to make them scalable but when I pass the group object the touches dont register?
thanks
hi @saad,
do you have touch handlers on your images as well ?
can you send me your code so i can take a better look at what you’re trying to accomplish ?
thanks
dmc
@dmc
Im using dgoldman’s bookclass. the full code is over here: https://github.com/dgoldman/2-page-open-book/blob/master/BookClass.lua
I’m implementing your multitouch code here:
[lua]local function bookLoop()
local screenExit = false
– Initialize the book - display pages 1 and 2
leftPage = display.newImageRect(book.page[1].image, book.page[1].width, book.page[1].height)
bookGroup:insert (leftPage)
leftPage.x, leftPage.y = -book.pageWidth/2, 0 – Set with respect to containing group
leftPage.isVisible = true
leftPage.pageID = “Left”
rightPage = display.newImageRect(book.page[2].image, book.page[2].width, book.page[2].height)
bookGroup:insert (rightPage)
rightPage.x, rightPage.y = book.pageWidth/2, 0 – Set with respect to containing group
rightPage.isVisible = true
rightPage.pageID = “Right”
params = {
minScale = 1,
maxScale = 3
}
MultiTouch.activate( leftPage, “scale”, ‘multi’, params )[/lua]
Instead of leftpage I want to put bookGroup
Thanks!
object:scale(x,y) is relative
object.xScale & object.yScale isn’t
in the book class, the function bookLoop() at line 475 sets touch event listeners on the class. i would guess that these are competing with the similar event listeners from MultiTouch.
dmc
Actually It doesn’t if I put rightPage or leftpage in your multitouch function it works if I put a group it doesnt work.
I’m not able to have the whole group zoom.
i tested my library using ordinary Corona display elements like your leftPage and rightPage so those will work.
i checked the BookClass again and saw that the touch listeners are being applied to the left and right pages. you will need to find out which objects get the initial touches - the group or the pages. this can be determined by adding prints inside of the listeners.
at the least, the group will have to get them first if the pinch/zoom is going to work correctly.
FYI: in any touch scenario, it’s unlikely that two different touch libraries are going to work harmoniously together.
dmc
Hello @dmc,
So I got the two libraries working together, dmc_multitouch and bookclass, except for multitouch the touches are only registered on the top left side of the screen and not the entire screen. Anay ideas why this could be happeneing? Using print statements I attempted to debug by checking where the size and location of the object getting the eventlistener in TouchManager:register but still nothing. I know Im asking alot but any help would be greatly appreciated.
Thanks
@dmccuskey, I’ve just come across your multiTouch library and would love to use it in a project I’m working on. Thanks for sharing so much so generously. Quick question I have is whether you have a G2 compatible version of the multiTouch library. Thank you very much.
@dmccuskey, honestly, I didn’t try it yet but assumed, perhaps wrongly so, given how much has changed between G1 to G2 that it would not work. I just wanted to see if you had an update in the works or something like that but I will happily give it a try if you think it might work. Thank you so very much for your time and interest.
I’m looking for pinch/zoom as well for Roomalyzr, so that people can add items to their rooms like lamps and furniture, and resize them to fit. Would like a nice, clean, simple code snippet…so subscribing to this thread! Thanks, Dan!
@dmccuskey, I’ve just come across your multiTouch library and would love to use it in a project I’m working on. Thanks for sharing so much so generously. Quick question I have is whether you have a G2 compatible version of the multiTouch library. Thank you very much.
@dmccuskey, honestly, I didn’t try it yet but assumed, perhaps wrongly so, given how much has changed between G1 to G2 that it would not work. I just wanted to see if you had an update in the works or something like that but I will happily give it a try if you think it might work. Thank you so very much for your time and interest.