0

How can I delete a group and all its children?

I found this post How to let a user delete a group of objects in kineticjs? which does not really answers the question.

I would do it like this:

group.destroyChildren();
group.destroy();

Is this the correct way or can I also use only the last line?

Community
  • 1
  • 1
confile
  • 30,949
  • 47
  • 199
  • 357

1 Answers1

1

You can use group.destroy() alone because group.destroy() also destroys all its children.

markE
  • 99,158
  • 11
  • 150
  • 168