Illumination of the object and background

How to light only object without a background?

 

brush.png:

display.setStatusBar( display.HiddenStatusBar ) local Group = display.newGroup() local snapshotMask = display.newSnapshot(2000, 2000) local maska = display.newRect(snapshotMask.group, 0, 0, 2000, 2000) maska:setFillColor(0) maska.alpha = 0.7 local light = display.newImageRect(snapshotMask.group,"brush.png",350,350) light.x = 50 light.y = 300 light.fill.blendMode = { srcColor = "zero", dstColor="oneMinusSrcAlpha" } local texture = display.newRect(200,250,200,200) local texture2 = display.newRect(400,240,800,480) texture2:setFillColor( 0.8,0,0 ) Group:insert( texture2 ) Group:insert( texture ) function onTouch( event ) light.x = event.x light.y = event.y snapshotMask:invalidate() end Runtime:addEventListener('touch', onTouch)

No one has any ideas?

Why can’t you use container?

Because several objects and they are not square.

No one has any ideas?

Why can’t you use container?

Because several objects and they are not square.

I think i can do that. Mail me at sahil19.sindh@gmail.com

I need to get the exact requirement.

I wrote

I think i can do that. Mail me at sahil19.sindh@gmail.com

I need to get the exact requirement.

I wrote