Remove element/function Corona SDK

Asked

Viewed 113 times

0

have file form.lua with the 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 is removed from the screen when going to another scene.

1 answer

0

If you are using Composer, put the object you want to delete inside a display group and in the Composer 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" so that another scene appears.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.