@Override public StringExpression concat(Object other) { return getDelegate().concat(other); }
/** * @return menu content with difficulty and playtime */ protected final MenuContent createContentGameplay() { log.debug("createContentGameplay()"); Spinner<GameDifficulty> difficultySpinner = new FXGLSpinner<>(FXCollections.observableArrayList(GameDifficulty.values())); difficultySpinner.increment(); app.getGameState().gameDifficultyProperty().bind(difficultySpinner.valueProperty()); String playtime = app.getGameplay().getStats().getPlaytimeHours() + "H " + app.getGameplay().getStats().getPlaytimeMinutes() + "M " + app.getGameplay().getStats().getPlaytimeSeconds() + "S"; return new MenuContent( new HBox(25, getUIFactory().newText(localizedStringProperty("menu.difficulty").concat(":")), difficultySpinner), new HBox(25, getUIFactory().newText(localizedStringProperty("menu.playtime").concat(":")), getUIFactory().newText(playtime)) ); }
private void addDebugView(Entity e) { Text textPos = new Text(""); textPos.textProperty().bind(e.xProperty().asString("(%.0f, ").concat(e.yProperty().asString("%.0f)"))); EntityView view = new EntityView(new Circle(2.5)); view.addNode(textPos); view.translateXProperty().bind(e.xProperty()); view.translateYProperty().bind(e.yProperty()); addGameView(view, RenderLayer.TOP); debugPositions.put(e, view); }
.bind(value .widthProperty() .asString("%.0f").concat(" x ").concat(value.heightProperty().asString("%.0f"))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ this.fileProperties.getChildren().addAll( this.imageSizeLabel, this.imageSizeValue);
.bind(value .widthProperty() .asString("%.0f").concat(" x ").concat(value.heightProperty().asString("%.0f"))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ this.fileProperties.getChildren().addAll( this.imageSizeLabel, this.imageSizeValue);
/** * @return menu content containing music and sound volume sliders */ protected final MenuContent createContentAudio() { log.debug("createContentAudio()"); Slider sliderMusic = new Slider(0, 1, 1); sliderMusic.valueProperty().bindBidirectional(app.getAudioPlayer().globalMusicVolumeProperty()); Text textMusic = getUIFactory().newText(localizedStringProperty("menu.music.volume").concat(": ")); Text percentMusic = getUIFactory().newText(""); percentMusic.textProperty().bind(sliderMusic.valueProperty().multiply(100).asString("%.0f")); Slider sliderSound = new Slider(0, 1, 1); sliderSound.valueProperty().bindBidirectional(app.getAudioPlayer().globalSoundVolumeProperty()); Text textSound = getUIFactory().newText(localizedStringProperty("menu.sound.volume").concat(": ")); Text percentSound = getUIFactory().newText(""); percentSound.textProperty().bind(sliderSound.valueProperty().multiply(100).asString("%.0f")); HBox hboxMusic = new HBox(15, textMusic, sliderMusic, percentMusic); HBox hboxSound = new HBox(15, textSound, sliderSound, percentSound); hboxMusic.setAlignment(Pos.CENTER_RIGHT); hboxSound.setAlignment(Pos.CENTER_RIGHT); return new MenuContent(hboxMusic, hboxSound); }
/** * https://github.com/AlmasB/FXGL/issues/493 * * @return menu content with video settings */ protected final MenuContent createContentVideo() { log.debug("createContentVideo()"); ChoiceBox<Language> languageBox = getUIFactory().newChoiceBox(FXCollections.observableArrayList(Language.values())); languageBox.setValue(Language.ENGLISH); getSettings().getLanguage().bind(languageBox.valueProperty()); VBox vbox = new VBox(); if (getSettings().isManualResizeEnabled()) { Button btnFixRatio = getUIFactory().newButton(localizedStringProperty("menu.fixRatio")); btnFixRatio.setOnAction(e -> { listener.fixAspectRatio(); }); vbox.getChildren().add(btnFixRatio); } if (getSettings().isFullScreenAllowed()) { CheckBox cbFullScreen = getUIFactory().newCheckBox(); cbFullScreen.setSelected(false); cbFullScreen.selectedProperty().bindBidirectional(getSettings().getFullScreen()); vbox.getChildren().add(new HBox(25, getUIFactory().newText(getLocalizedString("menu.fullscreen")+": "), cbFullScreen)); } return new MenuContent( new HBox(25, getUIFactory().newText(localizedStringProperty("menu.language").concat(":")), languageBox), vbox ); }
label.textProperty().bind(currentValue.asString("%.0f").concat("/").concat(maxValue.asString("%.0f")));
label.textProperty().bind(currentValue.asString("%.0f").concat("/").concat(maxValue.asString("%.0f")));