int menuChoice = 1; String lines[]; Vector species; float squareSize, range; String crops[] = { "Alfalfa","Apple","Apple1","Bean","Blueberry","Lentil","Pineapple","Potato","Rice","Rice1","Wheat"}; void setup(){ PFont font = loadFont("BenguiatITCbyBT-Bold-48.vlw"); squareSize = 0; species = new Vector(); framerate(15); size(1000,800); //800x 600 is nice textFont(font,18); rectMode(CENTER); int xSquares = 1; parseText(); //figure out biggest squares that will fit on your screen, given screensize & dataset //putting in a 100 pixel border int counter = 1; boolean fits = false; while (!fits){ squareSize = (height-200)/counter; xSquares = (int)((width-200)/squareSize); int totalSquares = counter * xSquares; if (totalSquares >= species.size()) fits = true; counter++; } range = squareSize/3; //march through array of species and assign coords for (int i =0; i < species.size(); i++){ float xCenter = 100+squareSize/2 + squareSize*(i%xSquares); float yCenter = 100+squareSize/2 + squareSize*(floor(i/xSquares)); ((Species)species.get(i)).defineCoords(xCenter, yCenter); } } void draw(){ background(50,50,0); menu(); stroke(155); textAlign(CENTER); for (int i=0; i