diff --git a/GameEngine/src/main/java/gameEngine/GameEditor.java b/GameEngine/src/main/java/gameEngine/GameEditor.java index 7d2f92d..8a1eeb6 100644 --- a/GameEngine/src/main/java/gameEngine/GameEditor.java +++ b/GameEngine/src/main/java/gameEngine/GameEditor.java @@ -15,25 +15,34 @@ private Button playButton; private Text playButtonText; + private Button openButton; + private Text openButtonText; + private Button createObjectButton; private Text createObjectButtonText; + private Button createTextButton; + private Text createTextButtonText; + public GameEditor(Scene scene) { this.scene = scene; initializeEditorComponents(); } private void initializeEditorComponents() { - EditorFrameSprite[0] = new Sprite(frameImagePath, 0, 0, 20, 0.5f); - EditorFrameSprite[1] = new Sprite(frameImagePath, 0, 0, 0.25f, 20); - EditorFrameSprite[2] = new Sprite(frameImagePath, Window.get().width-16, 0, 0.25f, 20); - EditorFrameSprite[3] = new Sprite(frameImagePath, 0, Window.get().height-16, 20, 0.5f); + createFrame(); playButton = new Button(Window.get().width/ 2 -16 , 3, 1, 0.4f); playButtonText = new Text(Window.get().width/ 2 - 11.25f, 1, "Play", 24); - createObjectButton = new Button(50, 3, 0.4f, 0.4f); - createObjectButtonText = new Text(50 +5.25f, 0.4f, "+", 24); + openButton = new Button(50, 3, 0.4f, 0.4f); + openButtonText = new Text(50 +5.25f, 0.4f, "+", 24); + + createObjectButton = new Button(20, 73, 3.2f, 0.5f); + createObjectButtonText = new Text(20 +5.25f, 70.4f, "Add GameObject", 24); + + createTextButton = new Button(20, 33, 3.2f, 0.5f); + createTextButtonText = new Text(20 +5.25f, 30.4f, "Add TextMesh", 24); setButtonListeners(); } @@ -44,6 +53,9 @@ createObjectButton.clearListeners(); createObjectButton.addListener(scene::addNewObject); + + createTextButton.clearListeners(); + createTextButton.addListener(scene::addNewTextMesh); } public void setScene(Scene newScene) { @@ -57,5 +69,14 @@ playButtonText.update(); createObjectButton.update(); createObjectButtonText.update(); + createTextButton.update(); + createTextButtonText.update(); + } + + private void createFrame(){ + EditorFrameSprite[0] = new Sprite(frameImagePath, 0, 0, 20, 0.5f); + EditorFrameSprite[1] = new Sprite(frameImagePath, 0, 0, 0.25f, 20); + EditorFrameSprite[2] = new Sprite(frameImagePath, Window.get().width-16, 0, 0.25f, 20); + EditorFrameSprite[3] = new Sprite(frameImagePath, 0, Window.get().height-16, 20, 0.5f); } }