rectMode

v0.1.7
rectMode(mode);

Set rectangle alignment mode.

Arguments

modeeither CENTER, CORNER, RADIUS

function setup()
  createWindow(200, 200);

  rectMode(CENTER);
end

function draw()
  background('purple');
  
  rect(width/2, height/2, 80, 40);
  point(width/2, height/2);
end

Output

function setup()
  createWindow(200, 200);

  rectMode(CORNER);
end

function draw()
  background('purple');
  
  rect(width/2, height/2, 80, 40);
  point(width/2, height/2);
end

Output

function setup()
  createWindow(200, 200);

  rectMode(RADIUS);
end

function draw()
  background('purple');
  
  rect(width/2, height/2, 80, 40);
  point(width/2, height/2);
end

Output

See rectMode in setting.h