rectMode(mode);Set rectangle alignment mode.
Arguments
modeeither CENTER, CORNER, RADIUSfunction setup()
createWindow(200, 200);
rectMode(CENTER);
end
function draw()
background('purple');
rect(width/2, height/2, 80, 40);
point(width/2, height/2);
endOutput
function setup()
createWindow(200, 200);
rectMode(CORNER);
end
function draw()
background('purple');
rect(width/2, height/2, 80, 40);
point(width/2, height/2);
endOutput
function setup()
createWindow(200, 200);
rectMode(RADIUS);
end
function draw()
background('purple');
rect(width/2, height/2, 80, 40);
point(width/2, height/2);
endOutput