I wrote a little example with the light module only, as far as I have unferstood what you want to achieve. I also added a button which removes the light which does not throw an error.
----------------------------------------------------------------------------------------- -- -- level8.lua -- Light only example -- ----------------------------------------------------------------------------------------- local composer = require( "composer" ) local scene = composer.newScene() local Light = require( "2dshadows.light" ) local Helper = require( "2dshadows.util.helper" ) local \_W, \_H, \_W2, \_H2 = math.floor( display.actualContentWidth + 0.5 ), math.floor( display.actualContentHeight + 0.5 ) local \_W2, \_H2 = \_W\*0.5, \_H\*0.5 function scene:create( event ) local sceneGroup = self.view local background = display.newImageRect( "img/bg2.jpg", \_W, \_H ) background.x, background.y = \_W2, \_H2 -- CREATE BLUE LIGHT local light1 = Light:new( 3, {0.5,0.5,0.7}, 0.7, 6 ) light1.x, light1.y = 0 , 0 light1:SetDraggable( true ) -- CREATE BUTTON local butRemoveLight = Helper:QuickButton("Remove") butRemoveLight.x = \_W2 butRemoveLight.y = 30 butRemoveLight:addEventListener( "tap", function() light1:Remove() end ) -- INSERT TO SCENEGROUP sceneGroup:insert( background ) sceneGroup:insert( light1 ) sceneGroup:insert( butRemoveLight ) end --------------------------------------------------------------------------------- -- Listener setup scene:addEventListener( "create", scene ) ----------------------------------------------------------------------------------------- return scene
So there must be something more you are doing?