NativeScreen

Client only. A screen of your own, from NativeUI.createScreen, in the game's interface. Build it from `root` once it is ready. While it has focus, Key.bind handlers pause and menu keys arrive as 'input' events: 'kcds_ui_accept' (Enter, Space), 'kcds_ui_back' (Escape, Backspace), and 'kcds_ui_left', 'kcds_ui_right', 'kcds_ui_up' and 'kcds_ui_down' (arrows and W A S D). Events are 'ready', 'unload', 'input' with (action, 'press' or 'release'), and 'event'.

nativeScreen.id

id

The screen's id.

nativeScreen.valid

valid

False once the screen has closed.

nativeScreen.ready

ready

Whether the screen can be built on.

nativeScreen.root

root

The root clip.

nativeScreen.host()

host(method, ...args)

Calls a function of the host movie. Returns undefined if it is not there.

nativeScreen.setVisible()

setVisible(visible = true)

Shows or hides the screen.

nativeScreen.focus()

focus()

Gives the screen the keyboard and mouse, so menu keys become its 'input' events.

nativeScreen.blur()

blur()

Returns the keyboard to the game.

nativeScreen.hasFocus()

hasFocus()

Whether the screen has focus.

nativeScreen.stage()

stage()

The movie's stage size as { width, height }, or null until known.

nativeScreen.screenToStage()

screenToStage(x, y)

Converts a window position to stage coordinates, or returns null.

nativeScreen.on()

on(event, handler)

Listens for a screen event: 'ready', 'unload', 'input' or 'event'.

nativeScreen.off()

off(event)

Removes your handlers of an event.

nativeScreen.watchClips()

watchClips()

Starts reporting clip mouse events for this screen. NativeClip.on does this for you.

nativeScreen.close()

close()

Closes the screen and frees it.