vector<flash::DisplayObject*> children;
flash::DisplayObject* DisplayObjectContainer::removeChild(flash::DisplayObject* child) {
for(int i = 0; i < children.size(); i++) {
if(children[i] == child) {
//ステージとの参照を切る
child->stage(NULL);
//親コンテナとの参照を切る
child->parent(NULL);
//配列から削除
children.erase(children.begin() + i);
return child;
}
}
//対象の子がなかったらエラー
throw "DisplayObjectContainer::removeChild\n";
}
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
List of users who liked
22