Mouse Press.
Mouse Press.
Move the mouse to position the shape. Press the mouse button to invert the color.
void setup() { size(640, 360); noSmooth(); fill(126); background(102); } void draw() { if (mousePressed) { stroke(255); } else { stroke(0); } line(mouseX-66, mouseY, mouseX+66, mouseY); line(mouseX, mouseY-66, mouseX, mouseY+66); }
Functions Used
noSmooth()
Draws all geometry and fonts with jagged (aliased) edges and images when hard edges between the pixels when enlarged rather than interpoloating pixels
Learn More
draw()
Called directly after setup(), the draw() function continuously executes the lines of code contained inside its block until the program is stopped or noLoop() is called
Learn More
background()
The background() function sets the color used for the background of the Processing window
Learn More