Skip to content

Commit

Permalink
Make instructions clearer
Browse files Browse the repository at this point in the history
  • Loading branch information
lingchen2333 committed Jan 21, 2025
1 parent a571c47 commit f229904
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions docs/sketch.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
let redSlider, greenSlider, blueSlider;
let brushSize = 2;
let brushSize = 0;

function setup() {
createCanvas(600, 600);
Expand All @@ -17,17 +17,19 @@ function setup() {
//text instructions
fill(100);
textSize(14);
text(`Press 's' or 'm' or 'l' for small, medium, or large brush size`,20,30);
text(`Eraser: press 'e'`, 20, 50);
text(`Clear canvas: press 'c'`, 20, 70);
text(`To start drawing:\n Press 's' or 'm' or 'l' to select brush size, and then click the mouse`,20,30);
text(`To erase: press 'e' and then click the mouse`, 20, 70);
text(`To clear canvas: press 'c' and then reselect your brush size`, 20, 90);
fill(255);
text(`Select your colour here:`,420,15);

//create sliders for red, green and green color:
redSlider = createSlider(0,255,127);
redSlider.position(600,0);
redSlider.position(600,20);
redSlider.size(100);

greenSlider = createSlider(0,255,127);
greenSlider.position(600,40);
greenSlider.position(600,50);
greenSlider.size(100);

blueSlider = createSlider(0,255,127);
Expand All @@ -39,11 +41,11 @@ function setup() {

fill(255,0,0);
textSize(15);
text(`red:`,550,15);
text(`red:`,550,35);

fill(0,255,0);
textSize(15);
text(`green:`,550,55);
text(`green:`,550,65);

fill(0,0,255);
textSize(15);
Expand All @@ -59,6 +61,7 @@ function draw() {
}
} else if (key == 'c'){
clearCanvas();
drawLine();
}
}

Expand All @@ -77,7 +80,7 @@ function keyPressed(){
function drawCircle(){
noStroke();
fill(242, 234, 191); //match the background colour
circle(mouseX, mouseY,50);
circle(mouseX, mouseY,30);
}

function colour(){
Expand All @@ -104,20 +107,22 @@ function clearCanvas(){
//text instructions
fill(100);
textSize(14);
text(`Press 's' or 'm' or 'l' for small, medium, or large brush size`,20,30);
text(`Eraser: press 'e'`, 20, 50);
text(`Clear canvas: press 'c'`, 20, 70);
text(`To start drawing:\n Press 's' or 'm' or 'l' to select brush size, and then click the mouse`,20,30);
text(`To erase: press 'e' and then click the mouse`, 20, 70);
text(`To clear canvas: press 'c' and then reselect your brush size`, 20, 90);
fill(255);
text(`Select your colour here:`,420,15);

//add labels to sliders
noStroke();

fill(255,0,0);
textSize(15);
text(`red:`,550,15);
text(`red:`,550,35);

fill(0,255,0);
textSize(15);
text(`green:`,550,55);
text(`green:`,550,65);

fill(0,0,255);
textSize(15);
Expand Down

0 comments on commit f229904

Please sign in to comment.