Corona supports 3 levels so that is a hard limit. If you can make a snapshot of the masked object and then mask the snapshot I suppose that could be a workaround. I’m not sure how masks would accept snapshots but there might be a way.
You do three masks, take a ‘snapshot’ of the group containing all the images, save that snapshot to disk, load it back as a new image and then continue masking on that image.
Yes, four masks must be nested in exactly one sprite.
There is one mask in the entire scene. So a total of five masks can be nested.
(The arrow mask image used in the test code is an image created for the public purpose, and the mask image used in my game is geometric and overlaps with each other.)
Depending on your objects. Another approach could be to have an object and fill it with another object (adjust the fill if needed) and then apply the mask to the first object (3 objects - 2 levels). You can also mess around with composite paint. These are all methods of used but they are specific to the ultimate goal and not a generic solution.
I have done mask + image capturing before in the app. But note that performing this will cause the app to lag. I do this while app is loading or during transitions. Maybe it will be ok on newer & faster phones.
After applying the mask + image, do a screen capture using display.captureBounds or display.captureScreen
Remember the 3-layer max limit, and this also includes any scroll view, text, etc that you have.