Type Function Library display.* Return value GroupObject Revision Current Public Release (2013.2076) Keywords groups, objects, grouping See also Display Groups and Coordinates
Creates a group in which you can add and remove child display objects. Initially, there are no children in a group. The local origin is at the parent’s origin; the reference point is initialized to this local origin.
Groups are created with a default reference point of TopLeftReferencePoint, where most other Display Objects are created with CenterReferencePoint. See the Gotchas section about changing group properties.
See Display Groups and Coordinates for more information.
You should have at least one DisplayObject inserted into a Display Group before you change or read any of the properties of the group (e.g.,
setReferencePoint(), etc.). There is a bug in Corona that will set/return properties with a very large value (2147483648) if a property is changed and the group is empty.
For further information, see the Physics Limitations guide.
Create a rectangle and a group, then insert the rectangle into the group:
local rect = display.newRect(0, 0, 100, 100) rect:setFillColor(140, 140, 140) local group = display.newGroup() group:insert( rect )