addChild method

void addChild(
  1. DFSprite sprite
)

增加子精灵

Implementation

void addChild(DFSprite sprite) {
  /// 绑定父和子的关系
  sprite.parent = this;
  children.add(sprite);
}