Example #1
0
 public void draw(Graphics2D g2, float x, float y) {
   float yPos = y - height;
   for (Box b : children) {
     yPos += b.getHeight();
     b.draw(g2, x + b.getShift() - leftMostPos, yPos);
     yPos += b.getDepth();
   }
 }
Example #2
0
 public void render(float x, float y, float s, int subX, int subY, int subXX, int subYY) {
   Box.draw(
       x - (s * (subXX - subX + 1) / 2),
       y - s * (subYY - subY + 1),
       s * (subXX - subX + 1),
       s * (subYY - subY + 1),
       (float) t.getWidth() / imageX * subX / t.getWidth(),
       (float) t.getHeight() / imageY * subY / t.getHeight() - 0.000001f,
       (float) (subXX - subX + 1) / imageW,
       (float) (subYY - subY + 1) / imageH,
       t);
 }
Example #3
0
  private void drawBoxes(Graphics g) {
    // Draw subboxes (behind main boxes)
    for (int n = 0; n < NUM_BOXES; n++) {
      subBoxs[n].draw(g).setVisible(subMenuVisible);
    }
    // Draw main boxes
    for (int n = 0; n < NUM_BOXES; n++) {
      // If box has no text make it invisible
      boxs[n].draw(g).setVisible(!boxs[n].hasNoText());
    }

    centralBox.draw(g);
  }
Example #4
0
  public void render(float x, float y, float w, float h, int subX, int subY) {

    // -0.000001f remove strange line between tiles
    Box.draw(
        x,
        y,
        w,
        h,
        (float) t.getWidth() / imageX * subX / t.getWidth(),
        (float) t.getHeight() / imageY * subY / t.getHeight() - 0.000001f,
        1f / imageX,
        1f / imageY,
        t);
  }
Example #5
0
  public void render(float x, float y, float w, float h, int subX, int subY, boolean centered) {

    if (!centered) {
      render(x, y, w, h, subX, subY);
      return;
    }
    // -0.000001f remove strange line between tiles
    Box.draw(
        x - w / 2,
        y - h,
        w,
        h,
        (float) t.getWidth() / imageX * subX / t.getWidth(),
        (float) t.getHeight() / imageY * subY / t.getHeight() - 0.000001f,
        1f / imageX,
        1f / imageY,
        t);
  }