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
Michael
  • 32,527
  • 49
  • 210
  • 370

1 Answers1

1

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

markE
  • 102,905
  • 11
  • 164
  • 176