display.remove()

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

Overview

Removes a group or object 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