Hello everybody
While using the snapshot library I’ve encountered a problem. If you want to add an event to a children (like a tap event) of the snapshot, you won’t be able to call the function event by “tapping” the children.
The thing is that I need to use the snapshot while having some images (children) which have tap events on them. What should I do? There is a function that allow me to do that?
P.S. I’m sorry, I’m not a native english speaker, I might have done some errors
This is an example:
local W=display.contentWidth
local H=display.contentHeight
local snap = display.newSnapshot( 300, 300 )
snap.x=W*0.5
snap.y=H*0.5
local space = display.newImageRect(“images/space.jpg”,300, 300)
snap.group:insert(space)
function foo(event)
print("the function has been called correctly ")
end
local blueRect = display.newImageRect(“images/blueRect.png”,30,30)
blueRect:addEventListener(“tap”,foo) --I can’t call this event by clicking on it.
snap.group:insert(blueRect)