Remove element / function Corona SDK

0

I have form.lua file with code:

local _M = {}

function _M.calc( a )

    local quad = display.newRect(100,100,100,100)
end
return _M

and the file scene2.lua with the code:

local form = require "form"

form.calc( )

I need the quad / function to be removed from the screen when I go to another scene.

    
asked by anonymous 04.02.2018 / 18:11

1 answer

0

If you are using the composer, put the object you want to delete within a display group and in the composer's hide function you put the object to be removed (display.remove (object)). So every time this scene that contains the quad, it will be removed when it is "hidden" for another scene to appear.

    
09.07.2018 / 13:12