Package shapes

Examples of shapes.ADXRectangle


    super(roomID, depth);
    this.x = x;
    this.y = y;
    this.width = width;
    this.height = height;
    r = new ADXRectangle(x, y, width, height);
  }
View Full Code Here


      width = (int) ADXMath.max(8 + fntFormat.getMaxWidth(text) + 8, 8 + 64 + 8);
      height = 8 + fntFormat.getTotalHeight(text) + 8 + 32 + 8;
    }
    x = (game.getWidth() - width) / 2;
    y = (game.getHeight() - height) / 2;
    r = new ADXRectangle(x, y, width, height);
    btnOK = new GUIButton(x + width - 64 - 8, y + height - 32 - 8, 64, 32, button, getRoomID(), getDepth());
    game.addInstance(btnOK);
   
  }
View Full Code Here

              }
            }
          }
          if (canPlace) {
            PlacableAsset a = new PlacableAsset(asset, mouseGridX, mouseGridY, selectedLayer);
            ADXRectangle r = new ADXRectangle(mouseGridX, mouseGridY, a.asset.width, a.asset.height);
            ADXRectangle r2 = new ADXRectangle(0, 0, 1, 1);
            boolean place = true;
            for (PlacableAsset p : lPAsset) {
              r2.setX(p.x);
              r2.setY(p.y);
              r2.setWidth(p.asset.width);
              r2.setHeight(p.asset.height);
              if (r.collides(r2)) {
                place = false;
                break;
              }
            }
            if (place) {
              lPAsset.add(a);
            }
          }
        }
      }
    }
    if (input.getButton(ADXInput.MOUSE_RIGHT)) {
      if (!drawAssets || input.getMouseX() > 256) {
        Layer l = lLayer.get(selectedLayer);
        ADXRectangle r = new ADXRectangle(mouseGridX, mouseGridY, 1, 1);
        ADXRectangle r2 = new ADXRectangle(0, 0, 1, 1);
        PlacableAsset p;
        for (int i = lPAsset.size() - 1; i >= 0; i--) {
          p = lPAsset.get(i);
          if (p.layer == l.code) {
            r2.setX(p.x);
            r2.setY(p.y);
            r2.setWidth(p.asset.width);
            r2.setHeight(p.asset.height);
            if (r.collides(r2)) {
              lPAsset.remove(i);
            }
          }
        }
View Full Code Here

TOP

Related Classes of shapes.ADXRectangle

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.