Multiple groups

Is there a way to have multiple groups when using director? [import]uid: 130035 topic_id: 24176 reply_id: 324176[/import]

You can use multiple groups, just be sure to insert them into the localGroup if you want them to automatically get cleaned up on a scene change :slight_smile: [import]uid: 52491 topic_id: 24176 reply_id: 97653[/import]

Can you give me an example of how to do that? [import]uid: 130035 topic_id: 24176 reply_id: 97655[/import]

Rough example with a few circles;

[lua]localGroup = display.newGroup() — this would be Director’s localGroup
myGroup = display.newGroup() — this would be your group

– a couple of circles
local circle1 = display.newCircle(160, 100, 20)
local circle2 = display.newCircle(160, 200, 20)
local circle3 = display.newCircle(160, 300, 20)

– put the circles into your group
myGroup:insert(circle1)
myGroup:insert(circle2)
myGroup:insert(circle3)

– put your group into Director’s localGroup
localGroup:insert( myGroup )[/lua]

Peach :slight_smile: [import]uid: 52491 topic_id: 24176 reply_id: 97673[/import]