// options
kumaleon.options = {
onInit: () => {
// called when the app is initialized
},
onUpdate: () => {
// called in requestAnimationFrame loop
},
onResize: () => {
// called when window resized
},
}
// p5 sample code
function setup() {
// pass a canvas element.
// If the canvas is not square, the center will be cropped.
kumaleon.setCanvas(createCanvas(windowWidth, windowHeight).canvas)
background(255)
noFill()
}
function drawPolygon(x, y, radius) {
const r = (Math.random() * 0.4 + 0.6) * radius
const offsetX = x + (Math.random() * 2 - 1) * r
const offsetY = y + (Math.random() * 2 - 1) * r