Simple question... Probably simple answer
in
Programming Questions
•
1 year ago
So I'm currently working on getting my first real applet down.
The snippet above would draw points where ever the mouse was moved to, which was cool. Now I'm trying to have the background colour and point colour change using mousePressed.
After doing this the points are no longer drawn but the background does change.
I've done this off of the getting started article: http://processing.org/learning/gettingstarted/
Please keep in mind that I'm the king of noobs right now, I honestly have no sort of understanding of what I'm doing and I'm trying to get a grasp of what seem like simple elements.
- void setup(){
- size(550, 550);
- }
- void draw() {
- point(mouseX, mouseY);
- }
The snippet above would draw points where ever the mouse was moved to, which was cool. Now I'm trying to have the background colour and point colour change using mousePressed.
- void setup(){
- size(550, 550);
- }
- void draw() {
- if (mousePressed) {
- background(255);
- fill(0);
- } else {
- background(0);
- fill(255);
- }
- point(mouseX, mouseY);
- }
After doing this the points are no longer drawn but the background does change.
I've done this off of the getting started article: http://processing.org/learning/gettingstarted/
Please keep in mind that I'm the king of noobs right now, I honestly have no sort of understanding of what I'm doing and I'm trying to get a grasp of what seem like simple elements.
1