public FXGLScrollPane(Node content) { this(); setContent(content); } }
public static ProgressBar makeHPBar() { ProgressBar bar = new ProgressBar(); bar.setHeight(25); bar.setFill(Color.GREEN.brighter()); bar.setTraceFill(Color.GREEN.brighter()); bar.setLabelVisible(true); return bar; }
public FXGLButton(String text) { super(text); getStyleClass().setAll("fxgl_button"); setFont(FXGLUIConfig.getUIFactory().newFont(22)); setAlignment(Pos.CENTER); setOnKeyPressed(e -> { if (e.getCode() == KeyCode.ENTER) { //FXGL.getAudioPlayer().playSound(FXGL.getSettings().getSoundMenuPress()); fire(); } }); // TODO: //setOnMouseEntered(e -> FXGL.getAudioPlayer().playSound(FXGL.getSettings().getSoundMenuSelect())); //setOnMouseClicked(e -> FXGL.getAudioPlayer().playSound(FXGL.getSettings().getSoundMenuPress())); }
public FXGLSpinner(ObservableList<T> items) { super(items); getStyleClass().setAll("fxgl-spinner"); getEditor().setFont(FXGLUIConfig.getUIFactory().newFont(18)); } }
public FXGLSpinner(ObservableList<T> items) { super(items); getStyleClass().setAll("fxgl-spinner"); getEditor().setFont(FXGL.getUIFactory().newFont(18)); } }
public void openAddDialog() { UI ui = app.getAssetLoader().loadUI("dialog_add_entity.fxml", new DialogAddEntityController()); MDIWindow window = new InGameWindow("Add Entity", InGameWindow.WindowDecor.ALL); window.setPrefSize(350, 300); window.setContentPane(new Pane(ui.getRoot())); app.getGameScene().addUINode(window); }
private void snapToWindowsY(int newY) { int height = (int) getHeight(); int newMaxY = newY + height; for (InGameWindow window : windows) { if (window == this) continue; int nodeMinY = (int) window.getLayoutY(); int nodeMaxY = (int) (window.getLayoutY() + window.getHeight()); if (between(newY, nodeMaxY - SNAP_SIZE, nodeMaxY + SNAP_SIZE)) { relocateY(nodeMaxY); break; } if (between(newMaxY, nodeMinY - SNAP_SIZE, nodeMinY + SNAP_SIZE)) { relocateY(nodeMinY - height); break; } } }
private void snapToWindowsX(int newX) { int width = (int) getWidth(); int newMaxX = newX + width; for (InGameWindow window : windows) { if (window == this) continue; int nodeMinX = (int) window.getLayoutX(); int nodeMaxX = (int) (window.getLayoutX() + window.getWidth()); if (between(newX, nodeMaxX - SNAP_SIZE, nodeMaxX + SNAP_SIZE)) { relocateX(nodeMaxX); break; } if (between(newMaxX, nodeMinX - SNAP_SIZE, nodeMinX + SNAP_SIZE)) { relocateX(nodeMinX - width); break; } } }
public FXGLChoiceBox() { super(); getStyleClass().add("fxgl-choice-box"); }
/** * Set top-left position of the window. * * @param x left x * @param y top y */ public final void setPosition(double x, double y) { relocate(x, y); }
public void setOnAction(EventHandler<ActionEvent> e) { btn.setOnAction(e); }
public void onExit() { app.getDisplay().showConfirmationBox("Exit?", yes -> { if (yes) app.exit(); }); }
public static ProgressBar makeSkillBar() { ProgressBar bar = new ProgressBar(); bar.setHeight(25); bar.setFill(Color.BLUE.brighter().brighter()); bar.setTraceFill(Color.BLUE); bar.setLabelVisible(true); return bar; } }
public void openColorAdjustDialog() { if (uiColorAdjust == null) { uiColorAdjust = app.getAssetLoader().loadUI("dialog_color_adjust.fxml", new ColorAdjustController()); } MDIWindow window = new InGameWindow("Color Adjust", InGameWindow.WindowDecor.ALL); window.setPrefSize(380, 450); window.setContentPane(new Pane(uiColorAdjust.getRoot())); app.getGameScene().addUINode(window); }
public FXGLScrollPane(Node content) { this(); setContent(content); } }
public static ProgressBar makeHPBar() { ProgressBar bar = new ProgressBar(); bar.setHeight(25); bar.setFill(Color.GREEN.brighter()); bar.setTraceFill(Color.GREEN.brighter()); bar.setLabelVisible(true); return bar; }
public void openEditDialog() { UI ui = app.getAssetLoader().loadUI("dialog_edit_entity.fxml", new DialogEditEntityController()); MDIWindow window = new InGameWindow("Edit Entity", InGameWindow.WindowDecor.ALL); window.setPrefSize(380, 450); window.setContentPane(new Pane(ui.getRoot())); app.getGameScene().addUINode(window); }
public static ProgressBar makeSkillBar() { ProgressBar bar = new ProgressBar(); bar.setHeight(25); bar.setFill(Color.BLUE.brighter().brighter()); bar.setTraceFill(Color.BLUE); bar.setLabelVisible(true); return bar; } }