Name
Group.Insert -- insert detached object after specified child
Synopsis
moai.DoMethod(id, "Insert", obj, pred)
Function
This method can be used to insert the detached object specified by obj to the group object specified by id. The detached object will be added after the child specified by pred. After this method returns the specified object will change its state from detached to attached. That is why you must no longer use functions that expect a detached object with this object now.

Before you can call this method, you have to put the group into a special state that allows the addition and removal of children. This can be done by running the Group.InitChange and Group.ExitChange methods on the respective group object.

Detached MOAI objects can be created either by calling the moai.CreateObject() function or by explicitly detaching them from their parent by using the Group.Remove method.

Inputs
id
id of the group object
obj
id of the object to insert
pred
the object will be inserted after this object
Example
See moai.CreateObject


Show TOC