Updates the constructor to automatically create a screen sized to the terminal, if no screen is set.
@@ -46,6 +46,10 @@ public class PanelBuilder {
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
}
+ if (currentScreen == null) {
+ currentScreen = new Screen(0, 0, widthInCharacters, heightInCharacters);
+ }
+
panel.createBufferStrategy(2); // Reduces draw time by ~200%.
panel.setFocusable(true);
return panel;
