Hi everyone,
I have few questions about relation between objects(orxGRAPHIC, orxANIMATION, orxOBJECT, etc...) and the configuration sections.
1-How do I get the section that was used to create an object instance?
2-Let's assume I have section1 and section2@section1 and I use orxXXXX_CreateFromConfig(section2)...how do I know what's the parent of section2?
3-from example in question 2, if I programmatically update section1 is there a way to reflect modification to runtime objects created from section2?
For now, thank you in advance.
Comments
Hi!
To avoid any confusion, we usually call them structures and use the term object only for orxOBJECTs.
Look for the *_GetName() functions (orxObject_GetName(), orxCamera_GetName()).
Try orxConfig_GetParent().
If the config has been modified (no matter how, programmatically or with file loads), current instances won't get affected, only new ones will reflect the changes.
There's one exception to that rule, an it's only in development mode when the resource watchlist is activated. In this case, when hot reload happens, some structures such as spawners, sounds, textures, will update immediately after the reload has happened. Here's the original thread about hot reload.