how to create multiple light sources?

Hey Guys,

So I’m making this game, and i have a scene where i need it to be dark, and have a flashlight to light only a portion of the screen, now this is easily done with a mask, BUT, what i need is multiple light sources at once, that can light few parts of the scene simultaneously, see quick example below:

masks_zpswppvcjxe.png

In the example image above, we have 3 light sources, 1 small circle, 1 big circle and 1 line of light, is it possible to do this type of effect? that is, to have multiple “light sources”?

Thanks in advance.

Roy.

Hi Roy,

I think a snapshot would work for you. Check out the sample “SnapshotEraser” in your Corona application folder for a starting point.

SampleCode > Graphics > SnapshotEraser

Best regards,

Brent

Ohhhh, thats a neat feature, it looks like a good direction!

Thanks!

Hi Roy,

I think a snapshot would work for you. Check out the sample “SnapshotEraser” in your Corona application folder for a starting point.

SampleCode > Graphics > SnapshotEraser

Best regards,

Brent

Ohhhh, thats a neat feature, it looks like a good direction!

Thanks!