theNeedle

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

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?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.