removeFromParent method

void removeFromParent([
  1. bool dispose = false
])

Removes this GDisplayObject from its parent GDisplayObjectContainer.

By default, the GDisplayObject instance is not disposed of when it's removed. Set dispose to true to dispose of the instance.

Throws a StateError if this GDisplayObject does not have a parent.

Implementation

void removeFromParent([bool dispose = false]) {
  $parent?.removeChild(this, dispose);
}