I’m trying to code some landmarks, (as shown in the image) but when you put the cursor on top of the landmark displays some info.
So far I manage to create this. But I just can’t figure out how to do what I want. Can someone help me please?
String[] place;
int radioIni = 50, radioFin = 800;
int rounds = 16;
int year =12;
/*
int month=
JAN = ENE.getChild();
FEB = ();
MAR = ();
APR = ();
MAY = ();
JUN = ();
JUL = ();
AGO = ();
SEP = ();
OCT = ();
NOV = ();
DEC = ();
int days= 365;
float knowledge = ellipse();
float intension = triangle ();
float publicity = rect ();
*/
Europa euro;
void setup() {
//size(displayWidth, displayHeight);
fullScreen();
place = loadStrings ("DATA_TRACKING PUBLICITARIO.csv");
//println (place.);
euro = new Europa();
}
void draw() { // spirals
background(255);
translate(width/2, height/2); // track everything to center
strokeWeight(10);
stroke(0);
point(0, 0);
noFill();
strokeWeight (2);
beginShape();
int ang = 360/year;
int rad = int(((radioFin-radioIni)*PI / rounds)/year); //16=rounds, 12=months
for (int i=-1; i<=194; i++) { //one year round (i<12 (months) in 16 years are 192
curveVertex(cos(radians(ang*i))*(radioIni+rad*i), sin(radians(ang*i))*(radioIni+rad*i));
}
endShape();
//}
//void europa {
//stroke(europa);
strokeWeight (12);
for (int i=0; i<=192; i++) { //one year round (i<12 (months) in 16 years are 192
//int ang = 360/12;
//int rad = int(((radioFin-radioIni)*PI / rounds)/year); //16=rounds, 12=months
point(cos(radians(ang*i))*(radioIni+rad*i), sin(radians(ang*i))*(radioIni+rad*i));
}
//void mouseClicked() {
//euro.draw(1, 200, 100);
euro.draw(3, 2, 1);
euro.draw(1, 2, 2);
euro.draw(0, 0, 0);
euro.draw(2, 0, 1);
euro.draw(2, 0, 2);
euro.draw(0, 0, 3);
}
class Europa {
int month= 12;
int year= 360;
float random;
float trip;
float publi;
color germany = color (255, 62, 255),
spain= color(0, 101, 255),
france = color(0, 146, 255),
italy = color(0, 182, 255),
uk = color(0, 219, 255),
europa = color(0, 0, 255);
int category;
int ang = 360/year;
int rad = int(((radioFin-radioIni)*PI / rounds)/year); //16=rounds, 12=months
Europa() {
//category = cat;
}
void draw (int category, int month, int year) {
strokeWeight(2);
if (category == 3){
fill(germany);
}
if (category == 0) {
//ellipse(px, py, 10, 10);
fill(0, 0, 255);
ellipse(cos(radians(ang*(month+year*12)))*(radioIni+rad*(month+year*12)), sin(radians(ang*(month+year*12)))*(radioIni+rad*(month+year*12)), 20, 20);
} else if (category == 1) {
float px = cos(radians(ang*(month+year*12)))*(radioIni+rad*(month+year*12));
float py = sin(radians(ang*(month+year*12)))*(radioIni+rad*(month+year*12));
triangle(px-20, py+40/py, px+px/py, py+20, px+20, py+40/py);
} else {
pushStyle();
rectMode(CENTER);
rect(cos(radians(ang*(month+year*12)))*(radioIni+rad*(month+year*12)), sin(radians(ang*(month+year*12)))*(radioIni+rad*(month+year*12)), 20, 20);
popStyle();
}
}
}