예제 #1
0
  public void createUI(GLEx g) {
    if (!isVisible) {
      return;
    }

    this.setup();

    int pointsLength = points.size();

    Progress point;
    int index;
    int frameD;
    int indexD;

    float size = (pointsLength * this.trailLength);

    for (float i = -1, l = size; ++i < l && !this.stopped; ) {

      index = (int) (frame + i);
      if (index < pointsLength) {
        point = points.get(index);
      } else {
        point = points.get(index - pointsLength);
      }
      this.alpha = (i / (l - 1));
      frameD = frame / (pointsLength - 1);
      indexD = (int) alpha;
      if (lineWidth > 0) {
        g.setLineWidth(lineWidth);
      }
      if (scaleX != 1 || scaleY != 1) {
        g.scale(scaleX, scaleY);
      }
      if (alpha > 0 && alpha < 1) {
        g.setAlpha(alpha);
      }
      g.setColor(color);
      step(g, point, indexD, frameD, color, alpha);
      g.resetColor();
      if (alpha > 0 && alpha < 1) {
        g.setAlpha(1);
      }
      if (lineWidth > 0) {
        g.resetLineWidth();
      }
      if (scaleX != 1 || scaleY != 1) {
        g.restore();
      }
    }
  }
예제 #2
0
 public void createUI(GLEx g) {
   if (visible) {
     LFont oldFont = g.getFont();
     int oldColor = g.getColorRGB();
     g.setFont(font);
     g.setColor(color);
     this.width = font.stringWidth(label);
     this.height = font.getSize();
     if (alpha > 0 && alpha < 1) {
       g.setAlpha(alpha);
       g.drawEastString(label, x(), y());
       g.setAlpha(1.0F);
     } else {
       g.drawEastString(label, x(), y());
     }
     g.setFont(oldFont);
     g.setColor(oldColor);
   }
 }