display.remove()

Type Function
Library display.*
Return value none
Revision 2017.3060
Keywords removing, deleting, objects
See also object:removeSelf()

Overview

Removes an object or group if not nil.

This is the same as calling object:removeSelf(), but will first check if the object exists before attempting to remove.

Syntax

display.remove( object )
object (required)

DisplayObject. The variable referencing the display object (vector, image or group) to be removed.

Example

display.remove( object )

-- is a faster way of doing this:

if object ~= nil then
    object:removeSelf()
end