|AGI_DECL agiRet WINAPI Add(|
- [in] The HAGI that should be added.
- [in] The HAGI parent.
bool bShow = true
- [in] Is visible or not.
agiOK on success.
An AGI object that was added to another AGI object will be affected by its parent transformations (e.g. rotation, movement). See also Hierarchy Concept (Understanding AGI).
It is advisable to build a hierarchial tree (add HAGIs to parents) after all HAGIs were initialized. Be sure the child and the parent HAGIs are valid, to avoid an error message.
// creating HAGIs
_hParent = Agi::createAbstract("Parent");
_hChild = Agi::createRect(10, 10, "Child");
// adding child to parent
int ret = Agi::Add(_hChild, _hParent);
if(ret != agiOK) // checking for success
SDK_WARNING("TEST", "one of the AGI handles are not valid");