Jump to content

Difference between clear(), remove() and destroy() methods of GameObjects.Group class


theNeedle
 Share

Recommended Posts

this.imageGroup = this.add.group();

for( var i = 0 ; i < 10 ; i++)
{
  var image = this.add.image(100*i, 100*i, "box"); // Add Image
  this.imageGroup.add(image); // added image to group
}

this.imageGroup.clear(true); // Remove all Children.

I'm using clear() method to remove all children of imageGroup. Can I add children to this group after performing clear. OR this group is deleted and I need to create another group.

And what is the difference between clear(), remove() and delete() methods of GameObjects.Group class?

Link to comment
Share on other sites

  • 3 months later...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...