class TheItem extends SimpleMapItem { String name; PImage c; color colorFill; String adjective; int fillValue; int TheSize; int countryNum; int countryTot; float currentZ; TheItem(String name) { this. name = name; } TheItem(String name, PImage c, color color_, String adjective, double TheSize, int countryNum, int countryTot) { this.countryNum = countryNum; this. name = name; this. TheSize = (int) TheSize; this. c = c; this. colorFill = color_; this.adjective = adjective; this.countryTot = countryTot; //fillValue = 200; } void draw( ) { //colorMode(HSB); if(termInUse.equals(name)){ //textFont(font); fillValue = 255; fill(colorFill) ; textFont(font); textAlign(LEFT,TOP) ; cam.beginHUD(); text(adjective + " " + name, border, border*10+(countryNum * 20)) ;//+95+82 /border *4 text(TheSize, 200-(border*5), border*10+(countryNum * 20)) ; text(round((((float)TheSize/(float)countryTot)*100.0)) + "%", 250-(border*5), border*10+(countryNum * 20)) ; /*fill(0,0,0,50); text(adjective + " " + name, border, border*2+(countryNum * 20)) ;//+95+82 /border *4 text(TheSize, 200-(border*5), border*2+(countryNum * 20)) ; text(round((((float)TheSize/(float)countryTot)*100.0)) + "%", 250-(border*5), border*2+(countryNum * 20)) ;*/ strokeWeight(1.1f) ;//0.5f stroke(255) ; line(border, border*10+(countryNum * 20)+15, border+((w+h))/2, border*10+(countryNum * 20)+15); stroke(colorFill) ; //line(x,y+5,315, 82+(countryNum * 20)-5); //line(x,y+5,200, border*2+(countryNum * 34)+20); //rect(border, border*2+(countryNum * 20)+15, ((w+h))/2, 1); line(border, border*10+(countryNum * 20)+15, border+((w+h))/2, border*10+(countryNum * 20)+15); cam.endHUD(); zAdd = 200; currentZ = currentZ + (((zAdd+0.5*round(TheSize/30.0))-currentZ)/20.0); pushMatrix(); translate(270,0); textFont(fontList[10]); textAlign(LEFT,TOP) ; text(TheSize + "/" + countries[countryNum*2+1],width+50,y) ; popMatrix(); } else{fillValue = 50;zAdd=0;currentZ = 0;} strokeWeight(0.25f) ; stroke(0) ; fill(colorFill, fillValue) ; //fill(colorFill,100) ; if (countryUp == countryNum && termInUse.equals(name)) {fill(colorFill,255+fillAccum); fillAccum = 0+((fillAccum + 1) % 155); } pushMatrix(); translate(x+round((w*0.5)),y+round((h*0.5)),currentZ);//zAdd+0.5*round(TheSize/30.0)); box(w,h,round(TheSize/30.0));// /*translate(0,0,100); fill(0,100,0) ; textFont(fontSmall); textAlign(CENTER,CENTER) ; text(adjective + " " + name, 0, 0) ;//+95+82 /border *4 //text(TheSize, 0, 0) ; */ popMatrix(); } void label( ) { //colorMode(RGB,255,255,255); if (countryUp == countryNum && termInUse.equals(name)) { textFont(font2); fill(colorFill) ; textAlign(LEFT,TOP); if(x>width/2){ textAlign(RIGHT,TOP); } int addY = 0; if(y>530){ addY = (-150); } /*cam.beginHUD(); fill(colorFill) ; textAlign(RIGHT,TOP) ; //text(adjective + " " + name + " " + TheSize, x+3 + w/2, y+2 + h/2 + addY) ; //fill(colorFill) ; text(adjective + " " + name, width - 10,10) ;//text(name, x + w/2, y + h/2 + addY) ; //text(name, x + w/2, y + h/2) ; text(TheSize + " " + round((((float)TheSize/(float)countryTot)*100.0)) + "%", width - 10,60) ; //fill(200,200,200) ; cam.endHUD();*/ //termInUse = name; //delay(1000); } } }