KAPLAYOpt<TPlugin, TButtonDef>:
KAPLAY configurations.
groupStart
Width of game.
Height of game.
Pixel scale / size.
If stretch canvas to container when width and height is specified
When stretching if keep aspect ratio and leave black bars on remaining spaces.
If register debug buttons (default true)
Key that toggles debug mode
font?: string
Default font (defaults to "monospace").
Device pixel scale (defaults to 1, high pixel density will hurt performance).
sincev3000.0
Disable antialias and enable sharp pixel display.
canvas?: HTMLCanvasElement
The canvas DOM element to use. If empty will create one.
root?: HTMLElement
The container DOM element to insert the canvas if created. Defaults to document.body.
background?: RGBValue | RGBAValue | string
Background color. E.g. [ 0, 0, 255 ] for solid blue background, or [ 0, 0, 0, 0 ] for transparent background. Accepts RGB value array or string hex codes.
Default texture filter.
How many log messages can there be on one screen (default 8).
How many seconds log messages stay on screen (default 4).
sincev3000.1
Size of the spatial hash grid for collision detection (default 64).
sincev3000.0
If translate touch events as mouse clicks (default true).
If KAPLAY should render a default loading screen when assets are not fully ready (default true).
sincev3000.0
If pause audio when tab is not active (default false).
sincev3000.0
gamepads?: Record<string, GamepadDef>
Custom gamepad definitions (see gamepad.json for reference of the format).
sincev3000.0
Defined buttons for input binding.
sincev30010
Limit framerate to an amount per second.
sincev3000.0
If focus on the canvas on start (default true).
sincev3001.0
If import all KAPLAY functions to global (default true).
List of plugins to import.
burp?: boolean
Enter burp mode.
Make component's id ("sprite" for sprite() comp) be added as tags.
That means .is() will return true for components with that id.
defaulttrue
experimentalThis feature is in experimental phase, it will be fully released in v4000.0
Padding used when adding sprites to texture atlas.
default0
experimentalThis feature is in experimental phase, it will be fully released in v4000.0