Name
Group.Remove -- detach object from group
Synopsis
moai.DoMethod(id, "Remove", obj)
Function
This method can be used to detach the specified object from the specified group. After this method returns the specified object will change its state from attached to detached. This means that you could now attach it to another group using a function like Group.Insert or you could free it using moai.FreeObject().

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.

Inputs
id
id of the group object
obj
id of the object to remove
Example
moai.DoMethod("mygroup", "initchange")
moai.DoMethod("mygroup", "remove", "mychild")
moai.DoMethod("mygroup", "exitchange", false)
The code above removes the child "mychild" from the group "mygroup". You could then attach "mychild" to another group or free it.

Show TOC