Type Function Library display.* Return value none Revision Release 2024.3703 Keywords removing, deleting, objects See also object:removeSelf()
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.
display.remove( object )
DisplayObject. The variable referencing the display object
local obj = display.newImage( "image.png" ) obj:translate( 100, 100 ) -- Remove the object display.remove( obj ) obj = nil