KAPLAYOpt
:KAPLAY configurations.
group
Start
width
?: numberWidth of game.
height
?: numberHeight of game.
scale
?: numberPixel scale / size.
stretch
?: booleanIf stretch canvas to container when width and height is specified
letterbox
?: booleanWhen stretching if keep aspect ratio and leave black bars on remaining spaces.
debug
?: booleanIf register debug buttons (default true)
debugKey
?: KeyKey that toggles debug mode
font
?: stringDefault font (defaults to "monospace").
pixelDensity
?: numberDevice pixel scale (defaults to 1, high pixel density will hurt performance).
since
v3000.0
crisp
?: booleanDisable antialias and enable sharp pixel display.
canvas
?: HTMLCanvasElementThe canvas DOM element to use. If empty will create one.
root
?: HTMLElementThe container DOM element to insert the canvas if created. Defaults to document.body.
background
?: RGBValue | RGBAValue | stringBackground 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.
texFilter
?: TexFilterDefault texture filter.
logMax
?: numberHow many log messages can there be on one screen (default 8).
logTime
?: numberHow many seconds log messages stay on screen (default 4).
since
v3000.1
hashGridSize
?: numberSize of the spatial hash grid for collision detection (default 64).
since
v3000.0
touchToMouse
?: booleanIf translate touch events as mouse clicks (default true).
loadingScreen
?: booleanIf KAPLAY should render a default loading screen when assets are not fully ready (default true).
since
v3000.0
backgroundAudio
?: booleanIf pause audio when tab is not active (default false).
since
v3000.0
gamepads
?: Record<string, GamepadDef>Custom gamepad definitions (see gamepad.json for reference of the format).
since
v3000.0
maxFPS
?: numberLimit framerate to an amount per second.
since
v3000.0
focus
?: booleanIf focus on the canvas on start (default true).
since
v3001.0
global
?: booleanIf import all KAPLAY functions to global (default true).
plugins
?: TPluginList of plugins to import.
burp
?: booleanEnter burp mode.
spriteAtlasPadding
?: numberPadding used when adding sprites to texture atlas.
default
0
experimental
This feature is in experimental phase, it will be fully released in v4000.0