Skip to content

Search

Dokumentation

window

The OS window and the display under it: mode, cursor, app icon, keep-awake, the safe area and the refresh rate.

På den här sidan

The OS window and the display under it: mode, cursor, app icon, keep-awake, the safe area and the refresh rate.

7 functions, 0 constants. Scripts reach it as window::.

Functions

Argument kinds are the script values a call passes: node is a node handle, any a table or value of any kind, fn a callback.

function acts on what it does
refresh_rate() -> float — Frames per second the display refreshes at, as measured over the last frames; 60 with no window.
safe_area() -> window::SafeArea — The display's insets in pixels, { left, top, right, bottom }: what a notch or a home bar covers, read once per frame and recorded. Zero on a desktop.
set_app_icon(string, window::AppIconOptions?) — Set the application icon, the dock or taskbar one, from a PNG or an SVG in the project. opts.plate colours the disc a macOS dock icon sits on, white by default. Replaces [application] icon for the run.
set_cursor_grab(bool) — Confine the cursor to the window, for FPS-style mouse look.
set_cursor_hidden(bool) — Hide or show the mouse cursor over the window.
set_keep_awake(bool) — Keep the screen from dimming while the game runs: a page takes a wake lock, a phone its equivalent, a desktop needs nothing.
set_window_mode(string) — windowed, maximized, fullscreen (borderless) or exclusive (the monitor's largest video mode): the same choice as [window] mode.

Är du säker?