int mainW = 330; int mainH = 250; int[] data; float posX = mainW/2; float posY = mainH/2; float diameter = 220; color blues = color(0, 125, 250, 250); color blues2 = color(30, 165, 255, 250); color greens2 = color(0, 250, 125, 250); color greens = color(0, 200, 100, 250); int sporecasts; int buddies; PFont f; float rot = 0; String bpcnt; String spcnt; String sp; int bdX = -70; int sdY = -30; XMLElement xml; void setup() { size(mainW, mainH); background(0); smooth(); noStroke(); noLoop(); f = loadFont("ArialMT-20.vlw"); //f = loadFont("AgencyFB-Reg-30.vlw"); textAlign(CENTER); xml = new XMLElement(this, "subscriptions.xml"); sporecasts = Integer.parseInt(xml.getChild("sporecasts").getContent()); buddies = Integer.parseInt(xml.getChild("buddies").getContent()); spcnt = Integer.toString(round(100*sporecasts/(sporecasts+buddies))); //sp = spcnt.substring(0,2); bpcnt = Integer.toString(round(100*buddies/(sporecasts+buddies))); } void draw(){ background(255); noStroke(); fill(blues); arc(posX, posY, diameter, diameter, -rot, 2*PI*buddies/(sporecasts+buddies)-rot); fill(greens); arc(posX, posY, diameter, diameter, 2*PI*buddies/(sporecasts+buddies) - rot, 2*PI -rot); fill(255); ellipse(posX, posY, diameter/2, diameter/2); textFont(f,20); /*float theta=atan2(mouseY-posY, mouseX-posX); if(theta<0) {theta = 2*PI+theta;} if(theta > -rot && theta < 2*PI*buddies/(sporecasts+buddies)-rot && dist(mouseX, mouseY,posX,posY) 2*PI*buddies/(sporecasts+buddies) - rot && theta < 2*PI -rot && dist(mouseX, mouseY,posX,posY)