Other great resources: Official JS API docs, Scripting Forum
getLabel()
Get the label, if any, associated with a game object...
Syntax
var labelName = getLabel(object);Parameters
Parameter | Type | Mandatory | Notes | Game version |
|---|---|---|---|---|
object | The object to inspect. | 3.2 |
Return value
Value | Type | Notes | Game version |
|---|---|---|---|
<labelName> | String | If the object has a label, the name of the label will be returned. If an object has multiple labels, only the first label found will be returned. | 3.2 |
| Null | The object is not labelled. | 3.2 |
<error> | Error | An error occurred, most likely invalid parameters. | 3.2 |
Notes
Be careful not to call a variable "label" as that's also the name of a global function: label()
Example
var theLabel = getLabel(someObject);