object.parent

Type GroupObject
Object DisplayObject
Library display.*
Revision Release 2022.3683
Keywords group, parent group
See also display.newGroup()

Overview

A read-only property that returns the object's parent.

Example

local group = display.newGroup()
 
local rect = display.newRect( 100, 100, 50, 50 )
rect:setFillColor( 0.7 )
group:insert( rect )
 
rect.parent:remove( rect )  --removes rect from group