User Tools

Site Tools


en:examples:objects:get_object_by_traversing_structures

This is an old revision of the document!


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.1518598066.txt.gz · Last modified: 2018/02/14 00:47 (6 years ago) by 127.0.0.1