Get the label, if any, associated with a game object... |
var labelName = getLabel(object); |
Parameter | Type | Mandatory | Notes | Game version |
---|---|---|---|---|
object | ![]() | The object to inspect. | 3.2 |
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 | Null | The object is not labelled. | 3.2 |
<error> | Error | An error occurred, most likely invalid parameters. | 3.2 |
Be careful not to call a variable "label" as that's also the name of a global function: label()
var theLabel = getLabel(someObject); |
This is a relatively slow operation of O(n) algorithmic complexity. |
Availability Requires:
|
ContentsJump to: |