public void update(String speed) { nifty .getCurrentScreen() .findElementByName("speedDisplay") .getRenderer(TextRenderer.class) .setText(speed + "km/h"); }
private void setMessageHUD(String text) { Element el = nifty.getCurrentScreen().findElementByName("messages"); if (text != null && el != null) { el.getRenderer(TextRenderer.class).setText(text); } }
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); }
public void showPopup() { nifty.showPopup(nifty.getCurrentScreen(), popup.getId(), null); }