vector<flash::DisplayObject*> children;
flash::DisplayObject* DisplayObjectContainer::removeChildAt(const int& index) {
//対象の子がなかったらエラー
if(index < 0 || index > children.size() - 1) throw "DisplayObjectContainer::removeChildAt\n";
DisplayObject* child = children[index];
//ステージとの参照を切る
child->stage(NULL);
//親コンテナとの参照を切る
child->parent(NULL);
//配列から削除
children.erase(children.begin() + index);
return child;
}
More than 5 years have passed since last update.
C++でのremoveChildAtの実装例
Last updated at Posted at 2014-03-02
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