Used to spawn large number of units.
The units are pooled internally, and only the units within a certain distance will be visible.
Constructors and accessors
Related sample code
Other related reference items
destroy_all_brushes ( self )Destroys all brushes in the scatter system.
|
self : | Specifies the object instance that this function will act on. You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation. |
This function does not return any values. |
destroy_brush ( self, brush_id )Destroys the specified brush and all units spawned by it.
|
self : | Specifies the object instance that this function will act on. You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation. | |
brush_id : | integer | The index of the brush to destroy. |
This function does not return any values. |
destroy_observer ( self, observer_id )Destroys the observer with the specified index.
|
self : | Specifies the object instance that this function will act on. You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation. | |
observer_id : | integer | The index of the observer to destroy. |
This function does not return any values. |
Related sample code
make_brush ( self, settings ) : integerCreates a new brush that spawns a particular kind of unit.
|
self : | Specifies the object instance that this function will act on. You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation. | |
settings : | A table that provides settings for the new brush. |
integer |
The index of the newly created brush. |
Other related reference items
make_observer ( self, position, rotation ) : integerCreates a new observer for the brush system.
|
self : | Specifies the object instance that this function will act on. You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation. | |
position : | The position of the observer. | |
rotation : | Optional; the rotation of the observer. The ? notation indicates that this type is optional: there may be zero or one instances of it. |
integer |
The index of the newly created observer. |
Observers determine which units are visible. There must be at least one observer in order for any brush units to be visible. Typically, you create a single observer and move it manually in order to synchronize it with the position of the viewing camera. You can also create multiple observers if you need the spawning of units to be controlled from multiple positions.
Related sample code
move_observer ( self, observer_id, position, rotation )Moves the observer to the specified position and rotation, and updates unit visibility accordingly.
|
self : | Specifies the object instance that this function will act on. You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation. | |
observer_id : | integer | The index of the observer to move. |
position : | The new position for the observer. | |
rotation : | Optional; the new rotation for the observer. The ? notation indicates that this type is optional: there may be zero or one instances of it. |
This function does not return any values. |
Related sample code
spawn ( self, brush_id, position, rotation ) : integerSpawns a unit using the specified brush at the specified position and rotation, and returns an index that you can use in a call to unspawn().
|
self : | Specifies the object instance that this function will act on. You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation. | |
brush_id : | integer | The index of the brush to use. |
position : | The position at which the unit is spawned. | |
rotation : | Optional; the starting rotation of the new unit. The ? notation indicates that this type is optional: there may be zero or one instances of it. |
integer |
The index of the newly spawned unit. |
unspawn ( self, unit_id )Unspawns the unit with the specified id.
|
self : | Specifies the object instance that this function will act on. You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation. | |
unit_id : | integer | The index of the unit to unspawn. |
This function does not return any values. |
Other related reference items