Hi alexfx,
I wrote a very similar function to the getMask function you have in your example but I’ve been having difficulties with this when running my app on different devices with different content scaling. In my case this seems to be because display.save() creates an image that is too big. ie on iphone 4 it’s 640px wide rather than 320px wide and the mask just appears to do nothing because it’s bigger than the screen.
This is what it says in the docs for display.save()
NOTE: When dynamic content scaling is enabled, display.save() saves the image in the device’s native resolution. For instance, if this method is used to save a 100 x 200 pixel display object, it will be saved as a 100 x 200 image on iPhone3 but it will be a 200 x 400 image on an iPhone4 (which would have the same content dimensions but more actual pixels). This is assuming that the config.lua file specifies the content width/height as 320x480 respectively.
Do you have any suggestions for this?