Examples of GenericLabel


Examples of org.spoutcraft.api.gui.GenericLabel

    this.parent = parent;
  }

  @Override
  protected void createInstances() {
    title = new GenericLabel("About");
    buttonDone = new GenericButton("Main Menu");
    scroll = new GenericScrollArea();
   
    labelSpoutcraftVersion = new GenericLabel(SpoutClient.getSpoutcraftVersion() + SpoutClient.getSpoutcraftBuild() + "\nLicensed under LGPLv3");
    labelMinecraftVersion = new GenericLabel("Copyright Mojang AB");
    labelSpoutcraftVersion.setAlign(WidgetAnchor.TOP_RIGHT);
    textureSpoutcraft = new ClientTexture(FileUtil.getAssetsDir().getPath()+"/logo/spoutcraft.png");
    textureMinecraft = new ClientTexture(FileUtil.getAssetsDir().getPath()+"/logo/minecraft.png");

    getScreen().attachWidgets("Spoutcraft", title, buttonDone, scroll, labelMinecraftVersion, labelSpoutcraftVersion, textureMinecraft, textureSpoutcraft);
View Full Code Here

Examples of org.spoutcraft.api.gui.GenericLabel

        }
      });
      image.url = attr.get("website");
      image.texture.setTooltip(attr.get("tooltip"));
      if (attr.containsKey("description") && !attr.get("description").isEmpty()) {
        image.description = new GenericLabel(attr.get("description"));
        image.description.setTextColor(new Color(0xaaaaaa));
      }
      this.images.add(image);

      // TODO Description
View Full Code Here

Examples of org.spoutcraft.api.gui.GenericLabel

    }
    return null;
  }

  public Section() {
    labelTitle = new GenericLabel("Untitled");
  }
View Full Code Here

Examples of org.spoutcraft.api.gui.GenericLabel

    logo.setGeometry((width / 2)-64, (height / 2)-60, 128, 32);
   
    logo.setLocal(true);
    logo.setDrawAlphaChannel(true);
   
    defaultText = new GenericLabel();
    defaultText.setAnchor(WidgetAnchor.CENTER_CENTER);
    defaultText.setAlign(WidgetAnchor.CENTER_CENTER);
    defaultText.setText(ChatColor.WHITE + "Loading terrain and custom resources");
    //  + "\n" + "\n" + ChatColor.MAGIC + "ShowMagic"
   
    statusText = new GenericLabel();
    statusText.setAnchor(WidgetAnchor.CENTER_CENTER);
    statusText.setAlign(WidgetAnchor.CENTER_CENTER);
    statusText.shiftYPos(20);
    statusText.setText("Activating cached resources...");
    getScreen().attachWidgets("Spoutcraft", logo, defaultText, statusText);
View Full Code Here

Examples of org.spoutcraft.api.gui.GenericLabel

    this.handler = handler;
    this.parent = parent;
  }

  protected void createInstances() {
    labelTitle = new GenericLabel(title);
    textText = new GenericTextField();
    textText.setWidth(200);
    textText.setText(text);

    buttonCancel = new GenericButton("Cancel");
View Full Code Here

Examples of org.spoutcraft.api.gui.GenericLabel

    this.parent = parent;
    this.bindings = bindings;
  }

  protected void createInstances() {
    title = new GenericLabel("Ambigous bindings\n" + ChatColor.GRAY + "The key you pressed has multiple bindings assigned.\n" + ChatColor.GRAY + "Please choose which action you want to summon.");
    buttonCancel = new GenericButton("Cancel");
    list = new GenericListWidget();

    int i = 1;
    for (AbstractBinding binding:bindings) {
View Full Code Here

Examples of org.spoutcraft.api.gui.GenericLabel

    z = edit.z;
    existed = true;
  }

  public void initGui() {
    GenericLabel label = new GenericLabel("Create Waypoint");
    int size = Spoutcraft.getMinecraftFont().getTextWidth(label.getText());
    label.setX((int) (width / 2 - size / 2)).setY(10);
    label.setFixed(true).setPriority(RenderPriority.Lowest);
    getScreen().attachWidget("Spoutcraft", label);

    int left = (int)(width / - 155);
    int right = (int)(width / 2 + 5);

    label = new GenericLabel("Waypoint Name:");
    size = Spoutcraft.getMinecraftFont().getTextWidth(label.getText());
    label.setX(left).setY(70);
    label.setFixed(true).setPriority(RenderPriority.Lowest);
    getScreen().attachWidget("Spoutcraft", label);

    name = new GenericTextField();
    name.setHeight(20).setWidth(300).setX(left).setY(81);
    name.setMaximumCharacters(0);
    name.setFixed(true).setPriority(RenderPriority.Lowest);
    name.setText(toEdit.name);
    getScreen().attachWidget("Spoutcraft", name);

    String text = "(" + x + ", " + y + ", " + z + ")";
    if (!SpoutClient.getInstance().isCoordsCheat()) {
      text = "Coords not shown";
    }
    label = new GenericLabel(text);
    size = Spoutcraft.getMinecraftFont().getTextWidth(label.getText());
    label.setX((int) (width / 2 - size / 2)).setY(106);
    label.setFixed(true).setPriority(RenderPriority.Lowest);
    getScreen().attachWidget("Spoutcraft", label);

    done = new GenericButton("Create");
    if (existed) {
      done.setText("Save");
View Full Code Here

Examples of org.spoutcraft.api.gui.GenericLabel

    recordButton = new GenericButton();
    recordButton.setGeometry(width - 160, top - 3, 150, labelHeight);
    getScreen().attachWidget("Spoutcraft", recordButton);
    updateRecordButton();

    titleLabel = new GenericLabel("Name:");
    titleLabel.setGeometry(left, top + 3, labelWidth, labelHeight);
    getScreen().attachWidget("Spoutcraft", titleLabel);

    commandName = new GenericTextField();
    commandName.setGeometry(right, top - 1, (int) (width - right - recordButton.getWidth() - 20), 16);
    commandName.setText(item.getTitle());
    commandName.setMaximumCharacters(0);
    commandName.setPlaceholder("Enter a name here");
    getScreen().attachWidget("Spoutcraft", commandName);

    top += 23;

    commandLabel = new GenericLabel("Command:");
    commandLabel.setGeometry(left, top + 3, labelWidth, labelHeight);
    getScreen().attachWidget("Spoutcraft", commandLabel);

    commandText = new GenericTextField();
    commandText.setGeometry(right, top - 1, width - right - 10, 16);
    commandText.setMaximumCharacters(0);
    commandText.setPlaceholder("Enter new command here, then click \"Add Command\"");
    getScreen().attachWidget("Spoutcraft", commandText);

    top += 23;

    delayLabel = new GenericLabel("Delay (ms)");
    delayLabel.setGeometry(left, top + 3, labelWidth, labelHeight);
    getScreen().attachWidget("Spoutcraft", delayLabel);

    delayText = new GenericTextField();
    delayText.setGeometry(right, top - 1, width - right - 10, 16);
View Full Code Here

Examples of org.spoutcraft.api.gui.GenericLabel

  int lastFPS = 0;
  int fpsDelay = 1;
  int poorFPSCount = 0;

  public MainMenu() {
    splashText = new GenericLabel(getSplashText());
    updateBackgrounds();

    Holiday holiday = Resources.getHoliday();
    if (holiday != null) {
      splashText.setText(holiday.getSplash());
View Full Code Here

Examples of org.spoutcraft.api.gui.GenericLabel

    multiplayer.setGeometry(width - 110, height - 130, 100, 20);

    resources = new GenericButton(translate.translateKey("options.resourcepack"));
    resources.setGeometry(width - 110, height - 105, 100, 20);

    buildNumber = new GenericLabel(SpoutClient.getSpoutcraftVersion() + SpoutClient.getSpoutcraftBuild());   
    textWidth = Spoutcraft.getRenderDelegate().getMinecraftFont().getTextWidth(buildNumber.getText());
    buildNumber.setTextColor(new Color(0x6CC0DC));
    buildNumber.setGeometry(Math.min(90 - textWidth, width - 296 - textWidth), height - 99, 75, 20);

    about = new GenericButton("About");
    about.setGeometry(Math.min(98, width - 288), height - 105, 51, 20);

    options = new GenericButton(translate.translateKey("menu.options"));
    options.setGeometry(Math.min(159, width - 227), height - 105, 51, 20);

    quit = new GenericButton(translate.translateKey("menu.quit"));
    quit.setGeometry(Math.min(220, width - 166), height - 105, 61, 20);

    background.setGeometry(0, 0, width, height);
    background.setPriority(RenderPriority.Highest);
    background.setAnchor(WidgetAnchor.TOP_LEFT);
    background.setLocal(true);

    splashText.setGeometry(Math.min(100, width - 245), height - 135, 200, 12);
    splashText.setTextColor(new Color(0x6CC0DC));
    textWidth = Spoutcraft.getRenderDelegate().getMinecraftFont().getTextWidth(splashText.getText());
    float scale = ((width - 225F) / textWidth);
    splashText.setScale(Math.min(1.5F, scale));

    logo = new ScaledTexture(FileUtil.getAssetsDir().getPath()+"/logo/spoutcraft.png");
    ((ScaledTexture) logo).setScale(Math.min(1F, (width - 135F) / 256F));
    logo.setGeometry(15, height - 185, 256, 64);
    logo.setLocal(true);
    logo.setDrawAlphaChannel(true);

    animate = new GenericLabel(ChatColor.ITALIC + "Animate");
    textWidth = Spoutcraft.getRenderDelegate().getMinecraftFont().getTextWidth(animate.getText());
    textWidth *= 75;
    textWidth /= 100;
    animate.setGeometry(width - textWidth - 2, height - 8, textWidth, 10);
    animate.setScale(0.75F);
    switch (Configuration.getMainMenuState()) {
      case 1:
        animate.setTextColor(new Color(0x00EE00));
        break;
      case 2:
        animate.setTextColor(new Color(0xFFFF00));
        break;
      case 3:
        animate.setTextColor(new Color(0xFF0000));
        break;
    }

    debugText = new GenericLabel();
    debugText.setTextColor(new Color(0xFFE303));
    debugText.setGeometry(1, 1, 12, 100);
    debugText.setVisible(false);
    this.getScreen().attachWidgets("Spoutcraft", singleplayer, multiplayer, resources, buildNumber, background, splashText, about, options,  logo, quit, animate, debugText);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.