NativeScreen
Defined in: client/api.d.ts:2819
A screen composed inside one of the game’s own Scaleform movies.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new NativeScreen(
id):NativeScreen
Defined in: client/api.d.ts:2824
Rebuilds a handle for a screen that already exists; use NativeUI.createScreen() to open one.
Parameters
Section titled “Parameters”number
Identifier of an existing screen.
Returns
Section titled “Returns”NativeScreen
Methods
Section titled “Methods”blur()
Section titled “blur()”blur():
void
Defined in: client/api.d.ts:2873
Gives up input focus, if this screen holds it.
Returns
Section titled “Returns”void
close()
Section titled “close()”close():
boolean
Defined in: client/api.d.ts:2855
Closes the screen, removing its subtree and every handler on it.
Returns
Section titled “Returns”boolean
True when it was still open.
focus()
Section titled “focus()”focus():
boolean
Defined in: client/api.d.ts:2868
Takes keyboard, controller and mouse input for this screen. One screen holds it at a time, and the game takes it back whenever a higher-priority context wants it.
Returns
Section titled “Returns”boolean
True when the screen now holds focus.
hasFocus()
Section titled “hasFocus()”hasFocus():
boolean
Defined in: client/api.d.ts:2879
Whether this screen currently holds input focus.
Returns
Section titled “Returns”boolean
True while it does.
off(
event):void
Defined in: client/api.d.ts:2906
Removes every handler this resource put on one notification.
Parameters
Section titled “Parameters”string
The notification to stop listening for.
Returns
Section titled “Returns”void
on(
event,handler):void
Defined in: client/api.d.ts:2900
Listens for one of this screen’s notifications. ready fires when the movie has composed the screen, which is not the same tick as the call that opened it; unload when the engine takes the movie away; input carries a focus action and its activation mode; event carries a declared movie event and its arguments.
Parameters
Section titled “Parameters”"input" | "ready" | "unload" | "event"
Which notification to listen for.
handler
Section titled “handler”Called on the next tick after it is raised.
Returns
Section titled “Returns”void
screenToStage()
Section titled “screenToStage()”screenToStage(
x,y): {x:number;y:number; } |null
Defined in: client/api.d.ts:2893
Converts a point on the player’s screen into this movie’s stage units, through the element’s own viewport mapping.
Parameters
Section titled “Parameters”number
Horizontal viewport fraction, 0 to 1.
number
Vertical viewport fraction, 0 to 1.
Returns
Section titled “Returns”{ x: number; y: number; } | null
The stage point, or null before the movie is composed.
setVisible()
Section titled “setVisible()”setVisible(
visible?):boolean
Defined in: client/api.d.ts:2862
Shows or hides this screen’s own subtree, leaving anything else in the same movie alone.
Parameters
Section titled “Parameters”visible?
Section titled “visible?”boolean
Defaults to true.
Returns
Section titled “Returns”boolean
True when the movie accepted it.
stage()
Section titled “stage()”stage(): {
height:number;width:number; } |null
Defined in: client/api.d.ts:2885
The movie’s authored stage size, which is what positions inside the screen are expressed in. It is independent of the player’s resolution.
Returns
Section titled “Returns”{ height: number; width: number; } | null
The stage size, or null before the movie is composed.
toString()
Section titled “toString()”toString():
string
Defined in: client/api.d.ts:2849
Formats this handle for logging.
Returns
Section titled “Returns”string
Properties
Section titled “Properties”
readonlyid:number
Defined in: client/api.d.ts:2829
Identifier of this screen, unique for the lifetime of the session.
readonlyready:boolean
Defined in: client/api.d.ts:2839
Whether the movie has composed it yet. A screen is asked for before its movie is ready, so this is false for the first few frames and root is null until it turns true.
readonlyroot:NativeClip|null
Defined in: client/api.d.ts:2844
The screen’s own empty root clip, and the parent everything else is created under. Null until ready.
readonlyvalid:boolean
Defined in: client/api.d.ts:2834
Whether the screen is still open.