Versions Compared
compared with
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Excerpt |
---|
Triggered when the user selects or deselects objects... |
Syntax
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
function eventSelectionChanged(selected) { // do stuff } |
Parameters
Parameter | Type | Mandatory | Description | Game version |
---|---|---|---|---|
selected | Array of | An array of selected game objects. Array will be empty if no objects are selected. | 3.2 |
Return value
Warzone does not process the event handler's return value.
Notes
The event is triggered after each selection change, but with a slight delay to avoid being triggered too many times.
Remember that a player might select objects one at a time, or in groups, or hold down shift to add or remove objects to or from the selection.
Example
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
function eventSelectionChanged(selectedObjects) { selectedObjects.forEach(function get(gameObject) { // do stuff with selected game object } } |
Div | ||||||
---|---|---|---|---|---|---|
| ||||||
Availability
Requires:
|
Div | ||||
---|---|---|---|---|
| ||||
ContentsJump to:
|
Div | ||
---|---|---|
| ||
See alsoRelated articles:
|