Example #1
0
  @Override
  public void angleBox(V2 o, V2 d, float size, boolean fill) {
    // move based on camera position where applicable
    V2 po = (use_camera) ? camera.getPerspective(o) : o;
    // scale direction-vector based on zoom
    V2 pd = (use_camera) ? d.clone().scale(camera.getZoom() * size) : d.clone().scale(size);

    int
        xpts
        [] =
            {
              (int) (po.x + pd.x + pd.y), (int) (po.x + pd.x - pd.y),
              (int) (po.x + -pd.x - pd.y), (int) (po.x + -pd.x + pd.y)
            },
        ypts
        [] =
            {
              (int) (po.y + -pd.x + pd.y), (int) (po.y + pd.x + pd.y),
              (int) (po.y + pd.x - pd.y), (int) (po.y + -pd.x - pd.y)
            };
    draw_queue.add(new DrawShape(new Polygon(xpts, ypts, 4), fill));
  }
Example #2
0
 // methods
 public DrawText(String text, V2 pos) {
   this.text = text;
   this.pos = pos.clone();
 }