Search in sources :

Example 1 with LevelText

use of com.almasb.fxgl.ui.LevelText in project FXGL by AlmasB.

the class ScifiSample method initUI.

@Override
protected void initUI() {
    getGameScene().removeUINode(levelText);
    getGameScene().removeUINode(panel);
    levelText = new LevelText("Level " + (level - 1));
    getGameScene().addUINode(levelText);
    panel = new InGamePanel();
    Text text = getUIFactory().newText("No Network Connection", Color.BLACK, 24.0);
    text.setTranslateX(getWidth() / 3 / 2 - text.getLayoutBounds().getWidth() / 2);
    text.setTranslateY(getHeight() / 2);
    panel.getChildren().add(text);
    getGameScene().addUINode(panel);
}
Also used : InGamePanel(com.almasb.fxgl.ui.InGamePanel) LevelText(com.almasb.fxgl.ui.LevelText) Text(javafx.scene.text.Text) LevelText(com.almasb.fxgl.ui.LevelText)

Example 2 with LevelText

use of com.almasb.fxgl.ui.LevelText in project FXGL by AlmasB.

the class InterpolatorSample method initGame.

@Override
protected void initGame() {
    LevelText text = new LevelText("Level 1");
    text.animateIn();
    player = Entities.builder().viewFromNode(text).buildAndAttach(getGameWorld());
}
Also used : LevelText(com.almasb.fxgl.ui.LevelText)

Aggregations

LevelText (com.almasb.fxgl.ui.LevelText)2 InGamePanel (com.almasb.fxgl.ui.InGamePanel)1 Text (javafx.scene.text.Text)1