NativeElement
Defined in: client/api.d.ts:3065
A handle on one of the game’s own UI elements, driven where it stands.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new NativeElement(
name,instanceId):NativeElement
Defined in: client/api.d.ts:3071
Rebuilds a handle for an element; use NativeUI.element() to get one.
Parameters
Section titled “Parameters”string
Element name, as its XML declares it.
instanceId
Section titled “instanceId”number
Instance id.
Returns
Section titled “Returns”NativeElement
Methods
Section titled “Methods”call()
Section titled “call()”call(
fn,args?):any
Defined in: client/api.d.ts:3104
Calls one of the element’s declared functions. The element has to be loaded: show it first, or call this on one the game already has up.
Parameters
Section titled “Parameters”string
A function the element’s XML declares, by its display name or its ActionScript name.
(string | number | boolean | null)[]
Scalar arguments. They may also be passed loose, one per parameter.
Returns
Section titled “Returns”any
What ActionScript returned, or null when the call failed.
getArray()
Section titled “getArray()”getArray(
name):any[] |null
Defined in: client/api.d.ts:3134
Reads one of the element’s declared arrays.
Parameters
Section titled “Parameters”string
An array the element’s XML declares.
Returns
Section titled “Returns”any[] | null
Its contents, or null when it is absent.
getClip()
Section titled “getClip()”getClip(
name): {alpha:number;rotation:number;scaleX:number;scaleY:number;visible:boolean;x:number;y:number; } |null
Defined in: client/api.d.ts:3149
Reads one of the element’s declared movie clips back. Scale and alpha come back as multipliers, the way setClip takes them.
Parameters
Section titled “Parameters”string
A movie clip the element’s XML declares.
Returns
Section titled “Returns”{ alpha: number; rotation: number; scaleX: number; scaleY: number; visible: boolean; x: number; y: number; } | null
Its display fields, or null when the clip is absent.
getVariable()
Section titled “getVariable()”getVariable(
name):any
Defined in: client/api.d.ts:3119
Reads one of the element’s declared variables.
Parameters
Section titled “Parameters”string
A variable the element’s XML declares.
Returns
Section titled “Returns”any
The value, or null when it is absent.
gotoClip()
Section titled “gotoClip()”gotoClip(
name,frameOrLabel,play?):boolean
Defined in: client/api.d.ts:3158
Moves a declared movie clip’s timeline, which is how a clip with several authored looks is switched between them.
Parameters
Section titled “Parameters”string
A movie clip the element’s XML declares.
frameOrLabel
Section titled “frameOrLabel”string | number
A one-based frame number, or a frame label.
boolean
Keep playing from there instead of stopping.
Returns
Section titled “Returns”boolean
True when the frame or label resolved.
hide()
Section titled “hide()”hide():
boolean
Defined in: client/api.d.ts:3170
Hides the element at once.
Returns
Section titled “Returns”boolean
True when the element took it.
off(
event):void
Defined in: client/api.d.ts:3201
Removes every handler this resource put on one event.
Parameters
Section titled “Parameters”string
The event to stop listening for.
Returns
Section titled “Returns”void
on(
event,handler):void
Defined in: client/api.d.ts:3195
Listens for one of the element’s declared events. This is how a click on a game screen reaches script.
Parameters
Section titled “Parameters”string
An event the element’s XML declares, by its display name.
handler
Section titled “handler”Called on the next tick after the movie raises it.
Returns
Section titled “Returns”void
reload()
Section titled “reload()”reload():
boolean
Defined in: client/api.d.ts:3182
Rebuilds the element’s movie from cached assets. Everything composed into it is gone afterwards.
Returns
Section titled “Returns”boolean
True when the element took it.
requestHide()
Section titled “requestHide()”requestHide():
boolean
Defined in: client/api.d.ts:3176
Asks the element to play its own hide transition instead of vanishing.
Returns
Section titled “Returns”boolean
True when the element took it.
setArray()
Section titled “setArray()”setArray(
name,values):boolean
Defined in: client/api.d.ts:3127
Replaces one of the element’s declared arrays. This is how the game’s own list screens are filled.
Parameters
Section titled “Parameters”string
An array the element’s XML declares.
values
Section titled “values”(string | number | boolean | null)[]
The new contents.
Returns
Section titled “Returns”boolean
True when the movie accepted it.
setClip()
Section titled “setClip()”setClip(
name,options):boolean
Defined in: client/api.d.ts:3142
Moves one of the element’s declared movie clips. Two of the game’s elements declare any: the HUD and the lockpicking screen.
Parameters
Section titled “Parameters”string
A movie clip the element’s XML declares.
options
Section titled “options”Only the fields present are applied.
alpha?
Section titled “alpha?”number
rotation?
Section titled “rotation?”number
scaleX?
Section titled “scaleX?”number
scaleY?
Section titled “scaleY?”number
visible?
Section titled “visible?”boolean
number
number
Returns
Section titled “Returns”boolean
True when the movie accepted it.
setVariable()
Section titled “setVariable()”setVariable(
name,value):boolean
Defined in: client/api.d.ts:3112
Assigns one of the element’s declared variables.
Parameters
Section titled “Parameters”string
A variable the element’s XML declares.
string | number | boolean | null
What to assign.
Returns
Section titled “Returns”boolean
True when the movie accepted it.
show()
Section titled “show()”show():
boolean
Defined in: client/api.d.ts:3164
Shows the element, loading its movie if it was not loaded.
Returns
Section titled “Returns”boolean
True when the element took it.
toString()
Section titled “toString()”toString():
string
Defined in: client/api.d.ts:3096
Formats this handle for logging.
Returns
Section titled “Returns”string
unload()
Section titled “unload()”unload():
boolean
Defined in: client/api.d.ts:3188
Drops the element’s movie. The next show loads it again.
Returns
Section titled “Returns”boolean
True when the element took it.
Properties
Section titled “Properties”instanceId
Section titled “instanceId”
readonlyinstanceId:number
Defined in: client/api.d.ts:3081
Which instance this handle drives. Instance 0 is the one the game itself uses; any other number is a private copy of the same element.
readonlyname:string
Defined in: client/api.d.ts:3076
The element’s name, as its XML declares it.
readonlyvalid:boolean
Defined in: client/api.d.ts:3086
Whether the element is still registered.
visible
Section titled “visible”
readonlyvisible:boolean
Defined in: client/api.d.ts:3091
Whether the element is visible right now.