User Tools

Site Tools


en:examples:objects:get_object_by_traversing_structures

Get OrxObject by Traversing Structures

orxSTRUCTURE *structure = orxStructure_GetFirst(orxSTRUCTURE_ID_OBJECT);
while (structure != orxNULL){
	orxOBJECT *object = orxOBJECT(structure);
	const orxSTRING objectName = orxObject_GetName(object);
	orxSTRUCTURE *nextStructure = orxStructure_GetNext(structure); 
	if (orxString_Compare(objectName , "SomeObjectName") == 0){
		orxObject_SetLifeTime(orxOBJECT(structure), orx2F(0.0));
	}
	structure = nextStructure;
}

See also

Object Traversing in the tutorial section for other methods.

Code example by gemberkoekje

en/examples/objects/get_object_by_traversing_structures.txt · Last modified: 2020/08/31 07:11 (4 years ago) by sausage