Skip to content
KCKingdoms Connected Scripting APIScripting guides and API
Runtime classClient APIGenerated

NativeScreen

Defined in: client/api.d.ts:2819

A screen composed inside one of the game’s own Scaleform movies.

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.

number

Identifier of an existing screen.

NativeScreen

blur(): void

Defined in: client/api.d.ts:2873

Gives up input focus, if this screen holds it.

void


close(): boolean

Defined in: client/api.d.ts:2855

Closes the screen, removing its subtree and every handler on it.

boolean

True when it was still open.


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.

boolean

True when the screen now holds focus.


hasFocus(): boolean

Defined in: client/api.d.ts:2879

Whether this screen currently holds input focus.

boolean

True while it does.


off(event): void

Defined in: client/api.d.ts:2906

Removes every handler this resource put on one notification.

string

The notification to stop listening for.

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.

"input" | "ready" | "unload" | "event"

Which notification to listen for.

NativeScreenHandler

Called on the next tick after it is raised.

void


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.

number

Horizontal viewport fraction, 0 to 1.

number

Vertical viewport fraction, 0 to 1.

{ x: number; y: number; } | null

The stage point, or null before the movie is composed.


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.

boolean

Defaults to true.

boolean

True when the movie accepted it.


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.

{ height: number; width: number; } | null

The stage size, or null before the movie is composed.


toString(): string

Defined in: client/api.d.ts:2849

Formats this handle for logging.

string

readonly id: number

Defined in: client/api.d.ts:2829

Identifier of this screen, unique for the lifetime of the session.


readonly ready: 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.


readonly root: 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.


readonly valid: boolean

Defined in: client/api.d.ts:2834

Whether the screen is still open.