Hi,
I would like to be able to select different circle A,B
When the A is selected and we select the B, the circle A should disappear and the checkbox A must be unchecked
Here is the exemple :
Thank you
var checkbox_a, checkbox_b;
var checkbox_a_go, checkbox_b_go;
function setup() {
createCanvas(400, 400);
checkbox_a = createCheckbox(‘A’, false);
checkbox_a.position(20, height + 20);
checkbox_a.changed(aaa);
checkbox_b = createCheckbox(‘B’, false);
checkbox_b.position(60, height + 20);
checkbox_b.changed(bbb);
}
aaa = function(){
checkbox_a_go = !checkbox_a_go;
if(this.checked()){
//checkbox_b_go = false;
//checkbox_c_go = false;
}}
bbb = function(){
checkbox_b_go = !checkbox_b_go;
if(this.checked()){
//checkbox_a_go = false;
// checkbox_c_go = false;
}}
function draw() {
background(220);
if(checkbox_a_go === true){
ellipse(50,50,100,100)
}
if(checkbox_b_go === true){
ellipse(200,200,200,200)
}
}