Final exams pt 5 Flashcards

1
Q

Describe the different procedures for mouse input

A
  • mousePressed() – called when a mouse button is pressed
  • mouseReleased() – called when a mouse button is released
  • mouseDragged() – called when the mouse is moved while a button is held down
  • mouseMoved () – called when the mouse is moved
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Write code that:
Draws a circle at the mouse cursor when the mouse is pressed

A

void mousePressed(){
ellipse(mouseX, mouseY, 100, 100);
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Draws a rect when the mouse is released

A

void mouseReleased(){
rect(mouseX, mouseY, 100, 200);
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Draws a trail of circles whenever the mouse moves

A

void mouseMoved(){
circle(mouseX, mouseY, 100);
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Describe the purpose of external libraries

A

add functions and features to program which have been
1) created by someone else
2) reused from other projects.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What line of code is needed to use an external library in a program?

A

import library name;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Describe some advantages of ControlP5 over other input types

A

1) simplifies program –> each button has procedure associated with it
2) large if statements NOT needed if you have many buttons
3) Buttons can be hidden/shown as needed in program.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly