Beispiel #1
0
    @Override
    public void renderObject(Graphics g2, UIMenu menu) {

      org.newdawn.slick.Color temp = g2.getColor();
      g2.setColor(
          FontHandler.getColorToSlick(
              textInput ? new Color(91, 91, 91, 185) : new Color(20, 20, 20, 185)));

      g2.fill(new Rectangle(x, y, width, height));

      g2.setColor(org.newdawn.slick.Color.white);
      FontHandler.resizeFont(g2, 22);
      FontHandler.changeFontStyle(g2, Font.BOLD);
      g2.drawString(worldName, renderStart + 3, y);

      FontHandler.resetFont(g2);

      if (textInput) {
        int xx = renderStart + 3 + (worldName != null ? worldName.length() * 12 : 0);

        FontHandler.resizeFont(g2, 22);
        g2.drawString("_", xx, y);
        FontHandler.resetFont(g2);
      }

      g2.setColor(temp);
    }
Beispiel #2
0
  @Override
  public void render(Graphics g2) {
    if (!worldName.isEmpty()) {
      createWorldButton.enabled = true;
    } else {
      createWorldButton.enabled = false;
    }

    org.newdawn.slick.Color temp = g2.getColor();

    super.render(g2);

    // g2.setPaint(p);
    g2.setColor(org.newdawn.slick.Color.black);

    FontHandler.resizeFont(g2, 16);
    FontHandler.changeFontStyle(g2, Font.BOLD);
    g2.drawString("Enter world name:", renderStart + 5, 100);
    FontHandler.resetFont(g2);

    g2.setColor(temp);
  }