setting

v0.1.7
background();

Clear a background with a color.

background(r, g, b);

Arguments

rThe red byte
gThe green byte
bThe blue byte
 background(100, 255, 100);
background(r, g, b, a);

Arguments

rThe red byte
gThe green byte
bThe blue byte
aThe alpha byte
 background(100, 255, 100, 150);
background(v);

Arguments

vThe grayscale value
 background(100);
background(color_name);

Arguments

color_nameThe color name
 background('yellow');
background(hex);

Arguments

hexThe hex color string
 background('#88EE66');

See background in setting.h
fill();

Set the fill color for shapes.

fill(r, g, b);

Arguments

rThe red byte
gThe green byte
bThe blue byte
 fill(100, 255, 100);
fill(r, g, b, a);

Arguments

rThe red byte
gThe green byte
bThe blue byte
aThe alpha byte
 fill(100, 255, 100, 150);
fill(v);

Arguments

vThe grayscale value
 fill(100);
fill(color_name);

Arguments

color_nameThe color name
 fill('yellow');
fill(hex);

Arguments

hexThe hex color string
 fill('#88EE66');

See fill in setting.h
strokeWeight(weight);

Set the line width.

Arguments

weightThe line width in pixels

strokeWeight(8);
line(200, 200, mouseX, mouseY);
See strokeWeight in setting.h
noFill();

Disable fill.

noFill();
circle(200, 200, 32);
See noFill in setting.h
stroke();

Set the stroke color for shapes

stroke(r, g, b);

Arguments

rThe red byte
gThe green byte
bThe blue byte
 stroke(255, 255, 100);
stroke(r, g, b, a);

Arguments

rThe red byte
gThe green byte
bThe blue byte
aThe alpha byte
 stroke(255, 255, 100, 150);
stroke(v);

Arguments

vThe grayscale value
 stroke(255);
stroke(color_name);

Arguments

color_nameThe color name
 stroke('red');

See stroke in setting.h
noStroke();

Disable stroke.

See noStroke in setting.h
push();

Save the style and transformation settings.

Pushes the lu5 style settings off the stack.
Pushes the OpenGL transformation matrix off the stack.

function setup()
    createWindow(400, 400);
end

function draw()
    background('purple');

    push();
    fill(155, 255, 0);
    strokeWeight(12);

    -- Affected by style
    circle(300, 200, 32);
    pop();

    -- Not Affected by style
    circle(100, 200, 32);
end
function setup()
    createWindow(400, 400);
end

function draw()
    background('purple');

    push();
    fill('red');
    translate(200, 200);

    -- Affected by transformation
    circle(0, 0, 32);
    pop();

    -- Not Affected by transformation
    circle(0, 0, 32);
end
See push in setting.h
pop();

Restore the style and transformation settings.

Pops the lu5 style settings off the stack.
Pops the OpenGL transformation matrix off the stack.

See pop in setting.h
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
debugMode([enable]);

Toggle a helpful mode with 3D Graphics.

Arguments

[enable]Whether or not to enable the debug mode, if not provided, it defaults to true

function setup()
  createWindow(800, 800, GL3D);

  debugMode();
end

function draw()
  background('purple');
  
  box(100);
end
function setup()
  createWindow(800, 800, GL3D);
end

function draw()
  background('purple');
  
  -- When the d key is down, show debug graphics
  if (keyIsDown('d')) then
    debugMode(true);
  else
    debugMode(false);
  end

  box(100);
end
See debugMode in setting.h
CENTERConstant

Alignment mode for rectMode.

See CENTER in setting.h
CORNERConstant

Alignment mode for rectMode.

See CORNER in setting.h
RADIUSConstant

Alignment mode for rectMode.

See RADIUS in setting.h