The code I have now I am having trouble getting the actual drawing under the picture, was told it may be the mousepressed section but could not solve the problem thank you!
PImage myElonStart, myMonroe, myLennon, selectOne,
lennonLil, monroeLil, elonLil, lennonBig, monroeBig, elonBig,
myBlueCan, myRedCan, myPinkCan, myGreenCan, myTanCan, myScroll,
mySave, myRestart, myBrush1, myBrush2, myBrush3, paintCan;
PFont thePopArtFont;
boolean saveTheImage =false;
boolean justSaved = false;
boolean showElon = false;
boolean showMonroe = false;
boolean showLennon = false;
boolean dispCol;
float col;
//***********COLORS*****************
color bluePaint = color(0, 144, 255);
color currentColor = color(0, 144, 255);
color black = color(0);
color redPaint = color(255, 4, 4);
color greenPaint = color (92, 207, 102);
color pinkPaint = color (253, 80, 116);
color tanPaint = color (245, 170, 91);
color orgBackground = color (255, 122, 10);
boolean typeIsCan=true;
void setup() {
size (1280, 720);
//colorMode(HSB, 100, 100, 100);
background(pinkPaint);
//load images
myElonStart = loadImage("elonData.png");
myMonroe = loadImage("monroeData.png");
myLennon = loadImage("lennonData.png");
lennonLil = loadImage("lennonLil.png");
monroeLil = loadImage("monroeLil.png");
elonLil = loadImage("elonLil.png");
lennonBig = loadImage("lennonBig.png");
monroeBig = loadImage("monroeBig.png");
elonBig = loadImage("elonBig.png");
paintCan = loadImage("paintCan.png");
mySave = loadImage("save.png");
myRestart = loadImage("restart.png");
myScroll = loadImage("scroll.png");
selectOne = loadImage("selectOne.png");
//load font
thePopArtFont = createFont("GoldenHillsDEMO.ttf", 50);
textFont(thePopArtFont);
}
void draw() {
colorMode(HSB, 100, 100, 100);
checkRollovers();
myBorder(); //Draws blue border around window
//Paint Tool
if (dispCol)
{
noStroke();
fill(col, 100, 100);
rect(8, 250, 85, 90);
}
stroke(0, 0, 0);
strokeWeight(35);
stroke(col, 100, 100);
strokeWeight(22);
if (mousePressed)
{
line(mouseX, mouseY, pmouseX, pmouseY);
}
fill(black);
text("Pop Art Paint Program", width/3, 50);
fill(redPaint);
text("Pop Art Paint Program", width/3.01, 47);
myButtonLayout();
}
void mouseWheel(MouseEvent event)
{
float e = event.getCount();
col += e;
if (col > 100) col = 0;
if (col < 0) col = 100;
dispCol = true;
}
void checkRollovers () {
//Save button rollover
if ((mouseX >100) && (mouseX <200) && (mouseY >618) && (mouseY <718)) {
saveTheImage=true;
cursor(WAIT);
} else {
saveTheImage=false;
cursor(ARROW);
}
//RESTART BUTTON CHECK
if ((mouseX>1051) && (mouseX <1162) && (mouseY>620) && (mouseY<710)) {
cursor(WAIT);
} else {
cursor(ARROW);
}
//Lennon Check
if ((mouseX>1188) && (mouseX <1288) && (mouseY>136) && (mouseY<236)) {
cursor(CROSS);
} else {
cursor(ARROW);
}
//Monroe Check
if ((mouseX>1188) && (mouseX <1288) && (mouseY>260) && (mouseY<360)) {
cursor(CROSS);
} else {
cursor(ARROW);
}
//Elon Check
if ((mouseX>1188) && (mouseX <1288) && (mouseY>377) && (mouseY<477)) {
cursor(CROSS);
} else {
cursor(ARROW);
}
}
void mousePressed() {
if (saveTheImage == true) {
saveImage();
background(redPaint);
justSaved = true;
saveTheImage = false;
}
if ((mouseX>10) && (mouseX<80) && (mouseY>5) && (mouseY<121))
{
typeIsCan =false;
currentColor = bluePaint;
}
}
void mouseReleased() {
if (justSaved == true) {
background(orgBackground);
justSaved = false;
}
//RESTART BUTTON
if ((mouseX>1051) && (mouseX <1162) && (mouseY>620) && (mouseY<710)) {
background(orgBackground);
}
//Lennon Big
if ((mouseX>1188) && (mouseX <1288) && (mouseY>136) && (mouseY<236)) {
image(lennonBig, width/3, 100);
}
//Monroe Big
if ((mouseX>1188) && (mouseX <1288) && (mouseY>260) && (mouseY<360)) {
image(monroeBig, width/3, 100);
}
//Elon Big
if ((mouseX>1188) && (mouseX <1288) && (mouseY>377) && (mouseY<477)) {
image(elonBig, width/4, 100);
}
}
void myBorder() {
fill(0, 144, 255);
noStroke();
rect(0, 0, 100, 611);
rect(0, 610, 1280, 720);
rect(1180, 0, 1280, 620);
}
void myButtonLayout() {
//Paint Can
image(paintCan, 0, height/3);
image(myScroll, 0, 180);
//Images of People
image(lennonLil, 1188, 136);
image(monroeLil, 1188, 260);
image(elonLil, 1188, 377);
image(selectOne, 1188, 100);
//Start Restart Button
image(mySave, 100, 615);
image(myRestart, 1080, 615);
}
void saveImage() {
PImage partialSave = get(115, 65, 1000, 535);
String path = sketchPath("Images/");
File file = new File(path);
int folderSize = 0;
if (file.exists() && file.isDirectory()) {
folderSize = file.listFiles().length;
}
partialSave.save(path+"PopArtImage" + folderSize + "jpg");
}
Example of what is happening