Function
buildnana
(gopt?: BUILDNANAOpt): BUILDNANACtxInitialize BUILDNANA context. The starting point of all BUILDNANA games.
// Start BUILDNANA with default options (will create a fullscreen canvas under <body>)
buildnana()
// Init with some options
buildnana({
width: 320,
height: 240,
font: "sans-serif",
canvas: document.querySelector("#mycanvas"),
background: [ 0, 0, 255, ],
})
// All BUILDNANA functions are imported to global after calling buildnana()
add()
onUpdate()
onKeyPress()
vec2()
// If you want to prevent BUILDNANA from importing all functions to global and use a context handle for all BUILDNANA functions
const k = buildnana({ global: false })
k.add(...)
k.onUpdate(...)
k.onKeyPress(...)
k.vec2(...) group Start