xxxxxxxxxx
39
input = [];
let buttons = [];
let but;
x = 0;
y = 0;
size = 25;
function setup() {
createCanvas(400, 400);
//building the buttons
k = 1
for (let i = 0; i < 3; i++) {
for (let j = 0; j < 3; j++) {
buttons[k] = new button(k);
buttons[k].show(j * 24 - 1 + x, i * 24 + y, size);
let index = k;
k++;
}
}
}
//output
function draw() {
let text = join(input, "");
console.log(text);
}
//button class
class button {
constructor(k) {
but = createButton(k);
}
show(x1, y1, s) {
but.position(x1, y1);
but.style('font-size', '11px');
but.size(s, s);
}
}