User Tools

Site Tools


en:examples:orx_scroll:delete_child_from_scrollobject_by_name

Delete a Child Object from a ScrollObject by Name

void Ship::DeleteChildByName(const orxSTRING childName) {
 
	for (ScrollObject *child = this->GetOwnedChild(); child; child = child->GetOwnedSibling()) {
		if (orxString_Compare(child->GetModelName(), childName) == 0) {
			child->SetLifeTime(0);
			return;
		}
	}
}
en/examples/orx_scroll/delete_child_from_scrollobject_by_name.txt · Last modified: 2018/02/14 00:47 (7 years ago) by 127.0.0.1