Salvatore "Sal" Testa /@saltesta14
void setup()
{
// called at the beginning
}
void draw()
{
// run every refresh
// default 60 frames per second
}
void setup()
{
size(400, 600); // width, height (pixels)
}
void setup()
{
size(400, 600);
}
void draw()
{
fill(255, 0, 0); // make fill color red
// centered at x, y and width, height
ellipse(200, 200, 300, 300);
}
void setup()
{
size(400, 600);
}
void draw()
{
fill(255, 0, 0);
ellipse(200, 200, 300, 300);
fill(0, 255, 0);
// top left x,y and width, height
rect(50, 250, 300, 300);
}
void setup()
{
size(400, 600);
}
int y = 0;
void draw()
{
fill(255, 0, 0);
ellipse(200, y, 300, 300);
y = y + 1; // update the y component
}
void setup()
{
size(400, 600);
}
int y = 0;
void draw()
{
background(255); // white background
fill(255, 0, 0);
ellipse(200, y, 300, 300);
y = y + 1;
}
void setup() {
size(512, 512);
}
void draw() {
}
// special method, every mouse click
void mousePressed() {
println("Mouse pressed at ("+mouseX+","+mouseY+")");
}
void setup() {
size(512, 512);
}
void draw() {
fill(255, 0, 0);
ellipse(256, 256, 100, 100);
}
void mousePressed() {
if (sq(mouseX-256)+sq(mouseY-256) < sq(50)) {
println("Circle! :)");
} else {
println("Not circle! :(");
}
}
Make a UI with at least 4 click-able events/objects. Examples:
Make an LED light switch with a UI using serial communication.