Other great resources: Official JS API docs, Scripting Forum

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

Returns a list of all currently defined labels...

 

Syntax

var list = enumLabels();

Parameters

The function has no parameters.

Return value

ValueTypeDescriptionGame version
<list>Array of String

A list of label names currently registered with the JS API.

Use label() to get the object associated with a label.

3.2
[]Empty ArrayIf there are no labels yet, an empty array is returned.3.2

Example

Iterate all labels, getting the objects associated with them...
enumLabel().forEach( function getObjectFor(labelName) {
	var obj = label(labelName); // retrieve object
	if (obj) {
		// do stuff with object
	} else {
		// there are no objects associated with this label
	}
} );
Availability 3.2+

Requires:

  • Warzone 3.2 and above.
Contents

Jump to:

Scripting: Labels

Related Objects:

 Create them:

List them:

Retrieve their objects:

Monitor them:

Remove them:

 

  • No labels