1919
2020import javafx .application .Platform ;
2121import javafx .geometry .Bounds ;
22+ import javafx .geometry .Insets ;
2223import javafx .geometry .Point2D ;
2324import javafx .scene .Group ;
2425import javafx .scene .canvas .Canvas ;
2526import javafx .scene .canvas .GraphicsContext ;
2627import javafx .scene .control .CheckMenuItem ;
2728import javafx .scene .control .ContextMenu ;
29+ import javafx .scene .control .Label ;
2830import javafx .scene .control .Menu ;
2931import javafx .scene .control .MenuItem ;
3032import javafx .scene .control .RadioMenuItem ;
3638import javafx .scene .image .WritablePixelFormat ;
3739import javafx .scene .input .KeyEvent ;
3840import javafx .scene .input .MouseButton ;
41+ import javafx .scene .layout .Background ;
42+ import javafx .scene .layout .BackgroundFill ;
3943import javafx .scene .layout .StackPane ;
4044import javafx .scene .paint .Color ;
45+ import javafx .scene .paint .Paint ;
4146import javafx .scene .shape .Line ;
47+ import javafx .scene .text .TextAlignment ;
4248import javafx .stage .PopupWindow ;
4349import se .llbit .chunky .PersistentSettings ;
4450import se .llbit .chunky .renderer .*;
@@ -64,6 +70,7 @@ public class RenderCanvasFx extends ScrollPane implements Repaintable, SceneStat
6470 private final Canvas canvas ;
6571 private final Group guideGroup ;
6672 private final StackPane canvasPane ;
73+ private final Label noChunksLabel ;
6774 private final RenderManager renderManager ;
6875 private int lastX ;
6976 private int lastY ;
@@ -93,6 +100,10 @@ public RenderCanvasFx(se.llbit.chunky.renderer.scene.Scene scene, RenderManager
93100 canvasPane = new StackPane (canvas );
94101 setContent (canvasPane );
95102
103+ noChunksLabel = new Label ("No chunks selected for rendering.\n Open a world and select and load chunks in the Map tab to get started." );
104+ noChunksLabel .setTextAlignment (TextAlignment .CENTER );
105+ canvasPane .getChildren ().add (noChunksLabel );
106+
96107 guideGroup = new Group ();
97108 Line hGuide1 = new Line ();
98109 Line hGuide2 = new Line ();
@@ -391,6 +402,9 @@ public void setRenderListener(RenderStatusListener renderListener) {
391402 tooltip .show (this ,
392403 offset .getX () + getScene ().getX () + getScene ().getWindow ().getX (),
393404 offset .getY () + getScene ().getY () + getScene ().getWindow ().getY () + getHeight ());
405+ noChunksLabel .setBackground (new Background (new BackgroundFill (Paint .valueOf ("#00000099" ),null ,null )));
406+ noChunksLabel .setPadding (new Insets (20 ));
407+ noChunksLabel .setVisible (!renderScene .haveLoadedChunks ());
394408 });
395409 }
396410
0 commit comments