コード例 #1
0
ファイル: GuiManager.java プロジェクト: ltpete/SkyHussars
 public void update(String speed) {
   nifty
       .getCurrentScreen()
       .findElementByName("speedDisplay")
       .getRenderer(TextRenderer.class)
       .setText(speed + "km/h");
 }
コード例 #2
0
  private void setMessageHUD(String text) {
    Element el = nifty.getCurrentScreen().findElementByName("messages");

    if (text != null && el != null) {
      el.getRenderer(TextRenderer.class).setText(text);
    }
  }
コード例 #3
0
  public EnergyDisplay(Nifty nifty) {
    mainEnergyBar = nifty.getCurrentScreen().findControl("mainEnergyBar", EnergyBar.class);
    engineEnergyBar = nifty.getCurrentScreen().findControl("engineEnergyBar", EnergyBar.class);
    scannerEnergyBar = nifty.getCurrentScreen().findControl("scannerEnergyBar", EnergyBar.class);
    gunnerEnergyBar = nifty.getCurrentScreen().findControl("gunnerEnergyBar", EnergyBar.class);
    shieldsEnergyBar = nifty.getCurrentScreen().findControl("shieldsEnergyBar", EnergyBar.class);
    transferEnergyBar = nifty.getCurrentScreen().findControl("transferEnergyBar", EnergyBar.class);
    cloakEnergyBar = nifty.getCurrentScreen().findControl("cloakEnergyBar", EnergyBar.class);
    builderEnergyBar = nifty.getCurrentScreen().findControl("builderEnergyBar", EnergyBar.class);

    mainEnergyBar.setMaxValue(645);
    mainEnergyBar.setCurrentValue(432);
  }
コード例 #4
0
 public void showPopup() {
   nifty.showPopup(nifty.getCurrentScreen(), popup.getId(), null);
 }