public void drawSelf(PGraphics g, int size) { for (int i = 0; i < 8; i += 2) { g.ellipse((float) corners[i], (float) corners[i + 1], size, size); } }
public static void sin(PApplet parent, PGraphics g, int amt, float freq, int xDiff, float size) { float v = (PApplet.sin((float) (parent.millis()) / 1000f * PConstants.TWO_PI * freq) + 1f) / 2f; g.noStroke(); g.ellipseMode(CENTER); g.fill(v * amt); g.ellipse(-xDiff, 0, size, size); g.ellipse(0, 0, size, size); g.ellipse(xDiff, 0, size, size); }
public void ellipse(float a, float b, float c, float d) { g.ellipse(a, b, c, d); }
g.ellipse(params[0], params[1], params[2], params[3]);
void drawStuff(PGraphics graphics){ graphics.ellipse(50, 50, 25, 25); }
mask.fill(transparent); mask.ellipseMode(CENTER); mask.ellipse(mouseX, mouseY, 200,200); mask.endDraw();
/** * ( begin auto-generated from ellipse.xml ) * * Draws an ellipse (oval) in the display window. An ellipse with an equal * <b>width</b> and <b>height</b> is a circle. The first two parameters set * the location, the third sets the width, and the fourth sets the height. * The origin may be changed with the <b>ellipseMode()</b> function. * * ( end auto-generated ) * @webref shape:2d_primitives * @param a x-coordinate of the ellipse * @param b y-coordinate of the ellipse * @param c width of the ellipse by default * @param d height of the ellipse by default * @see PApplet#ellipseMode(int) * @see PApplet#arc(float, float, float, float, float, float) */ public void ellipse(float a, float b, float c, float d) { if (recorder != null) recorder.ellipse(a, b, c, d); g.ellipse(a, b, c, d); }
PShape createReticle() { final int RADIUS = 64; PGraphics buffer = createGraphics(RADIUS, RADIUS); buffer.beginDraw(); buffer.background(0, 0); // transparent buffer.stroke(255); buffer.strokeWeight(4); buffer.ellipseMode(CENTER); buffer.ellipse(RADIUS / 2, RADIUS / 2, RADIUS / 3, RADIUS / 3); buffer.strokeWeight(8.0f); buffer.line(RADIUS/2, 0, RADIUS/2, RADIUS - 1); buffer.line(0, RADIUS/2, RADIUS-1, RADIUS/2); buffer.endDraw(); PShape face = createShape(); face.beginShape(QUAD); face.noStroke(); face.textureMode(NORMAL); face.texture(buffer); face.vertex(-1, -1, 0, 0, 0); face.vertex(1, -1, 0, 1, 0); face.vertex(1, 1, 0, 1, 1); face.vertex(-1, 1, 0, 0, 1); face.endShape(); return face; }
PGraphics sharedGraphics; void setup(){ size(500, 500); sharedGraphics = createGraphics(500, 500); } void draw(){ sharedGraphics.beginDraw(); sharedGraphics.background(0); for(int i = 0; i < 10000; i++){ sharedGraphics.ellipse(random(500), random(500), 5, 5); } sharedGraphics.endDraw(); image(sharedGraphics, 0, 0); println(frameRate); }
PGraphics pg; void setup() { size(200, 100); pg = createGraphics(100, 100); } void drawStuff(PGraphics graphics){ graphics.ellipse(50, 50, 25, 25); } void draw() { drawStuff(g); pg.beginDraw(); drawStuff(pg); pg.endDraw(); image(pg, 100, 0); }
canvas.fill(frontColor); canvas.noStroke(); canvas.ellipse( x, y, brushSize, brushSize); canvas.endDraw();
public void draw(PGraphics pg, boolean pdf) { pg.beginDraw(); pg.background(WHITE); if (canDraw()) { pg.noStroke(); float rad = 0; int a; int count = PApplet.min(500, points.size()); rad = PApplet.map(count, 0, 500, 0.05f, 0.01f); a = (int) PApplet.map(count, 0, 500, 70, 10); pg.fill(pg.red(COLOR), pg.green(COLOR), pg.blue(COLOR), a); for (Value2D pt : points) { float px = pg.width * (float) pt.x; float py = pg.height * (float) (1 - pt.y); float pw = pg.width * rad; float ph = pg.height * rad; if (50000 < points.size()) pg.rect(px - pw / 2, py - ph / 2, pw, ph); else pg.ellipse(px, py, pw, ph); } } else { drawCross(pg); } if (pdf) pg.dispose(); pg.endDraw(); }
gfx.rect(0,0,width,height); gfx.fill(255); gfx.ellipse(mouseX,mouseY,10,10); gfx.endDraw();
gfx.rect(0,0,width,height); gfx.fill(255); gfx.ellipse(mouseX,mouseY,10,10); gfx.endDraw();
pg.ellipse(x, y, w, h); } else { pg.noStroke();
if(alpha(glow.pixels[y*glow.width+x]) != 0) glow.ellipse(x,y,40,40);
mask.noStroke(); mask.fill(100); mask.ellipse(mouseX, mouseY, 200, 200); mask.endDraw();
pg.ellipse(x, y, w, h); } else { pg.noStroke();