0
votes

has 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 it goes to another scene.

1
yea, now do a translate to English. - hjpotter92

1 Answers

0
votes

Add display object to scene group so composer remove it for you.

form.lua

local _M = {}

function _M.calc( group )

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

scene2.lua

local form = require "form"

form.calc( scene.view )