Skip to content
KCKingdoms Connected Scripting APIScripting guides and API
Global objectClient APIGenerated

NativeUI

const NativeUI: object

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

The game’s own Scaleform UI, opened from script. This is the second way to draw a UI at this client, beside Web: a web view is a browser and lays out anything, a native screen is composed out of the game’s own movies, sits inside the game’s own layer stack and is navigable with a controller.

createScreen(options?): NativeScreen

Opens a screen. It is composed a few frames later, when its movie reports ready – listen for ready rather than drawing into it straight away.

library names which of the game’s movies the screen may attach exported sprites from, empty for the default. movie is a path inside this resource to a movie it ships, which opens a screen in that instead. assets are further files that movie loads, and layer is where it sits in the game’s own stack.

string[]

number

string

string

NativeScreen

The screen handle.

element(name, instanceId?): NativeElement

Takes a handle on one of the game’s own UI elements. Picking an instance id other than 0 gives a private copy of that element, which is how a mod puts its own content on a game screen without fighting the game’s copy.

string

Element name, as the game’s own XML declares it: Menu, hud, ApseModalDialog and the rest.

number

Which instance to drive; 0, the game’s own, by default.

NativeElement

The element handle.

isMenuEnabled(menu): boolean

Whether every resource permits this vanilla menu. Native gameplay rules may still prevent it from opening. Throws for unknown menu names.

"map" | "player" | "inventory" | "codex" | "journal" | "crafting"

The vanilla menu to query.

boolean

True when no resource disables the menu.

libraries(): object[]

Lists the game movies a screen can be opened against and the linkage names each one exports, read from the bundle rather than from a list kept in step by hand. name is what createScreen({library}) takes, and the empty one is the default host.

object[]

One entry per bundled library.

setMenuEnabled(menu, enabled): void

Prevents a vanilla menu from opening or being selected through native navigation. An already-open disabled menu closes on the next client tick. Requests are idempotent and resource-owned: a menu stays disabled while any resource disables it. Restrictions clear when the resource stops or the session ends. Key bindings are unchanged. Tab labels remain in the native screen. The custom character creator can still use the player stage.

"map" | "player" | "inventory" | "codex" | "journal" | "crafting"

The vanilla menu, including its detail pages.

boolean

False prevents opening the menu; true releases this resource’s restriction. All menus are enabled by default.

void