HELP!! MY CODE DUE IN 4 HOURS!! Trying to Have text appear on click
in
Programming Questions
•
8 months ago
Im really new to coding, I am trying to display data of my most played songs on itunes along with my personal rating for each song. I want the text by each ellipse to appear when I click on the ellipse...any suggestions? Ive been searching how to do this all morning but I am extremely confused.
int numbers [] = {76,67,64,57,57,41,41,41,38,38,37,35,33,32,31,31,30,29,28,28,26,26,25,25};
String song [] = {"Ball So Hard-HU¢¢I","Get Free-Major Lazer","Next One-HU¢¢I","Winter Is All Over You (Baauer Remix)-First Aid Kit","Look at Where we Are (Major Lazer Vs. Junior Blender)-Hot Chip","Dum Dum-Baauer","Hatch-HU¢¢I","FLOOD-RL Grime","Swimming Pools (Drank)-Kendrick Lamar","You A Lie(CRNKN X Branchez Remix)-Rockie Fresh","Original Choppaz-Heroes and Villains","Bueller-ECT!ECT!, Brillz & Diplo","Bricksquad Anthem-Mayhem","Scumbag-Bro Safari","Swoop-ECT!ECT! & Brillz","Royal Flush-Luminox","Dolly Parton-LOUDPVCK","The Recipie-Kendrick Lamar","Bot-Killah Kalam","Chirp-LOUDPVCK","F*cked up In the Club-FKI","Lana's Theme-Flosstradamus","Rollup (Baauer Remix)-Flosstradamus","In The Beginning-Zeds Dead"};
int rating [] = {10,3,8,5,6,8,9,10,7,9,10,8,9,3,6,7,4,8,4,6,7,6,2,10,8};
float scaler = 1;
void setup(){
size(800,900);
background(32,113,120);
smooth();
//Setup the program, size of the screen, background color and smooth to smooth out any jagged lines.
}
void draw(){
background(32,113,120);
translate(width/3,height/3);
scale(scaler);
stroke(0);
strokeWeight(1);
line(-10,0,10,0);
line(0,-10,0,10);
for (int i=0; i<numbers.length ; i++){
pushMatrix();
noStroke();
rotate(radians(360/23*i));
fill(255,150,102,180);
ellipse(numbers[i]*10,0,rating[i]*10,rating[i]*10);
fill(23,76,79);
ellipse(numbers[i]*10,0,10,10);
popMatrix();
fill(0,200);
float x = cos(radians(360/23*i)) * numbers[i]*10;
float y = sin(radians(360/23*i)) * numbers[i]*10;
fill(255);
text(song[i],x+rating[i],y);
text(rating[i] + " Hyph Rating", x+rating[i]/2, y+12);
stroke(245,233,190);
line(x,y,0,0);
}
}
void keyPressed(){
if(keyCode == UP){
scaler *= 1.25;
}
else if (keyCode == DOWN){
scaler *= .85;
}
}
1