I’m planning to add a page curl to an app so I was studying this code:
There are a few of things that I don’t understand and I was hoping you could help me.
First, it seems he is using the same mask on multiple images. I have always envisioned masks as images and images can only be in one display group. If I applied a mask to an image then I assume that if I applied it to a different image it would remove it from the first. Can you explain what really is going on to me?
Second, his mask1.png seems to be a white pixel to the left of a black pixel, what is that doing for him? I have used masks, mostly just a circle mask, but I was under the impression that I needed a black boundary all the way around the white part and that it needed to be at least 3 pixels (per this article): http://docs.coronalabs.com/guide/media/imageMask/index.html
Finally, and this doesn’t have anything to do with masks, why is he putting his display group in his metatable, is that just a way to keep from losing it? If I have a display group I need to keep handy, I have always just referenced it with a variable on the scene.view object. Is what I’m doing a bad practice? I realize he isn’t using composer, but why didn’t he just put it outside the function as a local variable to the module?
I’m assuming this works because of this video on YouTube: http://youtu.be/OsHrXZT3DGM