Package org.newdawn.slick.geom

Examples of org.newdawn.slick.geom.Polygon


        if (this.selectedFirefighterDepartment == null) {
            return false;
        }
       
       
        Polygon collidesWith = null;
        if (this.activeGraphicableVehicle.getPolygon().intersects(selectedFirefighterDepartment.getPolygon())) {
            collidesWith = selectedFirefighterDepartment.getPolygon();
        }
        boolean collides = collidesWith != null;
        if (collides && !this.activeGraphicableVehicle.isIsCollidingWithABuilding()) {
View Full Code Here


* @author salaboy
*/
public class Block  {
  public Polygon poly;
  public Block(int x, int y, int test[],String type) {
        poly = new Polygon(new float[]{
        x+test[0], y+test[1],
        x+test[2], y+test[3],
        x+test[4], y+test[5],
        x+test[6], y+test[7],
        });  
View Full Code Here

   
    /**
     * Generates the triangle to show when you can continue
     */
    public void triangulate() {
      triangle = new Polygon();
      triangle.addPoint(getWidth() - 30 + getX(), 60 +getY());
      triangle.addPoint(getWidth() - 30 + getX() + 10, 60 + getY());
      triangle.addPoint(getWidth() - 30  + getX() + 5, 60 + getY() + 10);
    }
View Full Code Here

    for (int x = 0; x < 10; x++) {
      for (int y = 0; y < 10; y++) {
        if (map[y][x] != 0) {
          switch (map[y][x]) {
          case 1:
            Polygon p2 = new Polygon();
            p2.addPoint(x * 32, y * 32);
            p2.addPoint((x * 32) + 32, y * 32);
            p2.addPoint((x * 32) + 32, (y * 32) + 32);
            p2.addPoint(x * 32, (y * 32) + 32);
            original.add(p2);
            //original.add(new Rectangle(x*32,y*32,33,33));
            break;
          case 2:
            Polygon poly = new Polygon();
            poly.addPoint(x * 32, y * 32);
            poly.addPoint((x * 32) + 32, y * 32);
            poly.addPoint(x * 32, (y * 32) + 32);
            original.add(poly);
            break;
          case 3:
            Circle ellipse = new Circle((x*32)+16,(y*32)+32,16,16);
            original.add(ellipse);
            break;
          case 4:
            Polygon p = new Polygon();
            p.addPoint((x * 32) + 32, (y * 32));
            p.addPoint((x * 32) + 32, (y * 32)+32);
            p.addPoint(x * 32, (y * 32) + 32);
            original.add(p);
            break;
          case 5:
            Polygon p3 = new Polygon();
            p3.addPoint((x * 32), (y * 32));
            p3.addPoint((x * 32) + 32, (y * 32));
            p3.addPoint((x * 32) + 32, (y * 32)+32);
            original.add(p3);
            break;
          case 6:
            Polygon p4 = new Polygon();
            p4.addPoint((x * 32), (y * 32));
            p4.addPoint((x * 32) + 32, (y * 32));
            p4.addPoint((x * 32), (y * 32)+32);
            original.add(p4);
            break;
          }
//          Polygon poly = new Polygon();
//          poly.addPoint(x * 64, y * 32);
 
View Full Code Here

    container.setMouseCursor("testdata/palette_tool.png", 0, 0);
   
    container.setIcons(new String[] {"testdata/icon.tga"});
    container.setTargetFrameRate(100);
   
    poly = new Polygon();
    float len = 100;
   
    for (int x=0;x<360;x+=30) {
      if (len == 100) {
        len = 50;
View Full Code Here

    p[3]=t.y-th/2;
    p[4]=t.x+tw;
    p[5]=t.y;
    p[6]=t.x+tw/2;
    p[7]=t.y+th/2;   
    return new Polygon(p);
  }
View Full Code Here

    rect = new Rectangle(400,100,200,150);
    round = new RoundedRectangle(150,100,200,150,50);
    round2 = new RoundedRectangle(150,300,200,150,50);
    center = new Rectangle(350,250,100,100);
   
    poly = new Polygon();
    poly.addPoint(400,350);
    poly.addPoint(550,320);
    poly.addPoint(600,380);
    poly.addPoint(620,450);
    poly.addPoint(500,450);
View Full Code Here

        shapes.add(roundRect);
        ellipse = new Ellipse(350, 40, 50, 30);
        shapes.add(ellipse);
        circle = new Circle(470, 60, 50);
        shapes.add(circle);
        polygon = new Polygon(new float[]{550, 10, 600, 40, 620, 100, 570, 130});
        shapes.add(polygon);
       
        keys = new boolean[256];
        lastChar = new char[256];
    }
View Full Code Here

    if (element.getNodeName().equals("path")) {
      points = element.getAttribute("d");
    }
   
    StringTokenizer tokens = new StringTokenizer(points, ", ");
    Polygon poly = new Polygon();
    int count = processPoly(poly, element, tokens);
   
    NonGeometricData data = Util.getNonGeometricData(element);
    if (count > 3) {
      Shape shape = poly.transform(transform);
     
      diagram.addFigure(new Figure(Figure.POLYGON, shape, data, transform));
    }
  }
View Full Code Here

    return this.up;
  }

  @Override
  public Shape toSlickShape() {
    Polygon poly = new Polygon();
    for (Vector relPoint : this.getPoints()) {
      poly.addPoint(relPoint.x, relPoint.y);
    }
    poly.setClosed(true);
    return poly;
  }
View Full Code Here

TOP

Related Classes of org.newdawn.slick.geom.Polygon

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.