void setup() { size(640, 360); colorMode(COLOR_MODE_HSB, height, height, height); noStroke(); background(height); }
void drawTargets() { background(51); noStroke(); drawTarget(width*0.25, height*0.4, 200, 4); drawTarget(width*0.5, height*0.5, 300, 10); drawTarget(width*0.75, height*0.3, 120, 6); }
void setup() { size(200, 200); smooth(); noStroke(); max_distance = dist(0, 0, width, height); }
// Width and Height void drawWidthHeight() { background(127); noStroke(); for (int i = 0; i < height; i += 20) { fill(129, 206, 15); rect(0, i, width, 10); fill(255); rect(i, 0, 10, height); } }
void setup() { size(640, 360); noStroke(); colorMode(COLOR_MODE_HSB, numChars); background(numChars / 2); // Set a gray value for each key for (int i = 0; i < numChars; i++) { colors[i] = COLOR(i, numChars, numChars, 255); } }
void setup() { size(200, 200); smooth(); noStroke(); e1 = Eye(50, 16, 80); e2 = Eye(64, 85, 40); e3 = Eye(90, 200, 120); e4 = Eye(150, 44, 40); e5 = Eye(175, 120, 80); }
//Draws a button void drawARDTButton (ARDTButton& pButton){ if (pButton.imageIndex < 255){ drawARDTButtonImage (pButton); return; } byte r, g, b; r = (byte)((pButton.bgcolor & 0xFF0000) >> 16); g = (byte)((pButton.bgcolor & 0x00FF00) >> 8); b = (byte)((pButton.bgcolor & 0x0000FF)); fill(r,g,b); //fill //button DRAWN is smaller than its zone RECT vDrawRect; byte vPadding = ((pButton.attributes & BUTTON_ATTRIBUTE_NOPADDING)> 0 ? 0 : 6); vDrawRect.top = pButton.rect.top + vPadding; vDrawRect.bottom = pButton.rect.bottom - vPadding; vDrawRect.left = pButton.rect.left + vPadding; vDrawRect.right = pButton.rect.right - vPadding; if ((pButton.attributes & BUTTON_ATTRIBUTE_BGGRADIENT)> 0){ //GRADIENT FILL noStroke(); for (int i=vDrawRect.top; i < vDrawRect.bottom; i += BTN_FILL_STEP){ byte vHeight = BTN_FILL_STEP; if (i + vHeight > vDrawRect.bottom) vHeight = vDrawRect.bottom - i; rect(vDrawRect.left,i,vDrawRect.right - vDrawRect.left,vHeight); if (r > BTN_FILL_STEP) r -= BTN_FILL_STEP; if (g > BTN_FILL_STEP) g -= BTN_FILL_STEP; if (b > BTN_FILL_STEP) b -= BTN_FILL_STEP; fill(r,g,b); //fill } } else { //UNIFORM PAINT rect(vDrawRect.left,vDrawRect.top,vDrawRect.right - vDrawRect.left,vDrawRect.bottom - vDrawRect.top); } if ((pButton.attributes & BUTTON_ATTRIBUTE_HASBORDER)> 0){ //finally draw border stroke(180,180,180); noFill(); rect(vDrawRect.left,vDrawRect.top,vDrawRect.right - vDrawRect.left,vDrawRect.bottom - vDrawRect.top); } //last draw the text r = (pButton.forecolor & 0x00FF0000) >> 16; g = (pButton.forecolor & 0x0000FF00) >> 8; b = (pButton.forecolor & 0x000000FF); stroke(r,g,b); noFill(); text(pButton.label,vDrawRect.left+4, vDrawRect.top + ((vDrawRect.bottom - vDrawRect.top) /2)); //print the character string }
void draw(){ //translate(x - 320, y); background(0); fill(255); rect(160, 0, 160, 180); rectMode(CORNER); for (int i = 0; i < 7; x = 10+20*i, i++){ for (int j = 0; j < 9; y = 10+20*j, j++ ){ if(i + j == 1){ continue; } fill(255); rect(x-4-i, y-4-i, 4+i, 4+i); for (int i = 0; i < 7; x = 170+20*i, i++ ){ for (int j = 0; j < 9; y = 10+20*j, j++ ){ if(i + j != 1){ continue; } noStroke(); fill(255); if(i==2){print("piirretaan!!\n");} rect(x-10+i, y-10+i, 11-i, 21-i); } } } } pushMatrix(); for (int i = 0; i < 7; x = 170+20*i, i++ ){ for (int j = 0; j < 9; y = 10+20*j, j++ ){ if(i + j != 1){ continue; } noStroke(); fill(255); if(i==2){print("piirretaan!!\n");} rect(x-10+i, y-10+i, 11-i, 21-i); } } popMatrix(); }
void draw() { background(224,224,224,255); //background(pLightGray); //background(aliceblue); // plot area as white box fill(255); rectMode(CORNERS); noStroke(); rect(plotX1, plotY1, plotX2, plotY2); drawTitle(); // plot the actual columnar data stroke(0x56, 0x79, 0xc1, 255); strokeWeight(5); drawDataPoints(currentColumn); drawYearLabels(); drawVolumeLabels(); drawAxisLabels(); }
/** * Paint the BarGraph */ void BarGraph::paint(void) { char outStr[25]; char outValueStr[6]; //draw bargraph Background and outine stroke(fgColorR, fgColorG, fgColorB); fill(bgColorR, bgColorG, bgColorB); rect(xLocation, yLocation, graphWidth, graphHeight); //draw the bargraph label and value dtostrf(currValue, 5, 1, outValueStr); sprintf(outStr,"%s %s", graphLabel, outValueStr); text(outStr, xLocation, yLocation-10); //draw the bar noStroke(); fill(fgColorR, fgColorG, fgColorB); rect(xLocation, yLocation, valueClamped * ((float)graphWidth / (maxValue - minValue)), graphHeight); }
void drawRecursion() { noStroke(); drawCircle(width / 2, 280, 6); }
void setup() { size(640, 360); noStroke(); rectMode(CENTER); }