CONTROL:clone
CONTROL:clone(
new_object_name,
parent_name,
data
)
Create a new control (new_object_name), within an existing parent layer or group (parent_name) by copying all of the properties of this control. This new object will have all of the same actions, variables and it's current state will match the state of this control.
- Controls and tables can be cloned into either layer or group parents as long as no name conflict exists.
The data argument is a table of properties that match the properties for that type of object as described in the gre.set_control_attrs() or gre.set_table_attrs() functions as applicable.
Parameters
| Parameter | Type | Description |
|---|---|---|
new_object_name | string | The name for the new object, this must be a unique name in the parents namespace. |
parent_name | string | The name of the layer or group to place this object within, this object must exist data. |
data | table (Optional) | A table containing control attribute tags as the keys with new values to be applied. |
Returns
| Type | Description |
|---|---|
gredom#control | A CONTROL object representing the newly created control. |