Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Excerpt

Triggered when the user selects or deselects objects...

 

Syntax

Code Block
themeEclipse
languagejavascript
linenumberstrue
function eventSelectionChanged(selected) {
  // do stuff
}

Parameters

ParameterTypeMandatoryDescriptionGame version
selected

Array of
Game objects

(tick)

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
themeRDark
languagejavascript
titleIterate through selected game objects...
linenumberstrue
function eventSelectionChanged(selectedObjects) {
	selectedObjects.forEach(function get(gameObject) {
		// do stuff with selected game object
	}
}
Div
classbox
Availability
Status
colourYellow
title3.2+

Requires:

  • Warzone 3.2 and above
Div
classbox
Contents

Jump to:

Table of Contents
maxLevel5

Div
classbox

See also

Related articles: