Package processing.core

Examples of processing.core.PShape


    g.scale(wscale, hscale);
   
    if(_randomFills==null && _randomStrokes==null) {
      g.shape(_shape, drawX,drawY, w,h);
    } else for(int i=0; i<_shape.getChildCount(); ++i) {
      PShape childShape = _shape.getChild(i);
     
      // HACK Workaround for children having 0 size
      childShape.width = _shape.width;
      childShape.height = _shape.height;
     
View Full Code Here


  }
   
  public void analyzeShape(PShape shape) {
    if (shape.getFamily() == PShape.GROUP) {
      for (int i = 0; i < shape.getChildCount(); i++) {
        PShape child = shape.getChild(i);
        analyzeShape(child);
      }
    }
    else if (shape.getFamily() == PShape.PATH) {
      analyzePath(shape);
View Full Code Here

  }

  public void updateShape(String shapeName, ShapeFeature shapeFeature, boolean update) {
    if (!update) {
      // Create shape
      PShape shape = createShape();
      shape.beginShape();
      shape.stroke(30);
      //shape.fill(255, 0, 0, 4);
      shape.fill(color(255, 0, 0), 100);
      updateShapeVertices(shape, shapeFeature, false);
      shape.endShape();

      // Add shape AND add to name list to retrieve later
      shapeGroup.addChild(shape);
      shapeGroup.addName(shapeName, shape);
    }
    else {
      // Get shape via name list (and not via index)
      PShape shape = shapeGroup.getChild(shapeName);
      // PShape shape = shapeGroup.getChild(i);

      updateShapeVertices(shape, shapeFeature, true);
    }
  }
View Full Code Here

  }

  public PShape createShapeGroup() {
    shapeGroup = createShape(PShape.GROUP);
    for (int i = 0; i < dotNumber; i++) {
      PShape shape = createShape();
      shape.beginShape(QUAD);
      shape.noStroke();
      shape.fill(255, 0, 0, 100);
      PVector pos = new PVector();
      shape.vertex(pos.x, pos.y);
      shape.vertex(pos.x + 4, pos.y);
      shape.vertex(pos.x + 4, pos.y + 4);
      shape.vertex(pos.x, pos.y + 4);
      shape.endShape();
      shapeGroup.addChild(shape);
    }
    return shapeGroup;
  }
View Full Code Here

  public void mapChanged(MapEvent mapEvent) {
    // Check map area only once after user interaction.

    for (int i = 0; i < shapeGroup.getChildCount(); i++) {
      PShape shape = shapeGroup.getChild(i);
      PVector pos = map.getScreenPosition(dots.get(i).location);
      shape.setVertex(0, pos.x, pos.y);
      shape.setVertex(1, pos.x - 4, pos.y);
      shape.setVertex(2, pos.x - 4, pos.y - 4);
      shape.setVertex(3, pos.x, pos.y - 4);
    }
  }
View Full Code Here

  }

  public List<PShape> createShapes() {
    List<PShape> shapes = new ArrayList<PShape>();
    for (int i = 0; i < 100; i++) {
      PShape shape = createShape();
      shape.beginShape(QUAD);
      shape.noStroke();
      shape.fill(255, 0, 0, 100);
      PVector pos = new PVector();
      shape.vertex(pos.x, pos.y);
      shape.vertex(pos.x + 4, pos.y);
      shape.vertex(pos.x + 4, pos.y + 4);
      shape.vertex(pos.x, pos.y + 4);
      shape.endShape();
      shapes.add(shape);
    }
    return shapes;
  }
View Full Code Here

TOP

Related Classes of processing.core.PShape

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.