diff --git a/examples/Basic/Basic.pde b/examples/Basic/Basic.pde index 54458a1..d76539e 100644 --- a/examples/Basic/Basic.pde +++ b/examples/Basic/Basic.pde @@ -57,13 +57,11 @@ class Scene1 implements Scene { this.parent = parent; } - @Override public void setupScene() { // Specific scene setup, if necessary println("Scene1 setup completed."); } - @Override public void sceneRender(PGraphics pg) { pg.pushMatrix(); pg.background(0, 0, 80, 0); @@ -86,13 +84,11 @@ class Scene1 implements Scene { pg.popMatrix(); } - @Override public void keyPressed(char key) { // Implement key response logic, if necessary println("Key pressed in Scene1: " + key); } - @Override public void mouseEvent(MouseEvent event) { // Implement mouse event logic, if necessary println("Mouse event in Scene1: " + event.getX() + ", " + event.getY() + ", button: " + event.getButton()); diff --git a/examples/ChangeScene/ChangeScene.pde b/examples/ChangeScene/ChangeScene.pde index 521a9a4..884bd09 100644 --- a/examples/ChangeScene/ChangeScene.pde +++ b/examples/ChangeScene/ChangeScene.pde @@ -46,8 +46,9 @@ void keyPressed() { // Forward mouse events to the library void mouseEvent(processing.event.MouseEvent event) { ziviDome.mouseEvent(event); + // Optionally call mouseEvent of the current scene if (currentScene != null) { - currentScene.mouseEvent(event.getX(), event.getY(), event.getButton()); + currentScene.mouseEvent(event); } } @@ -64,13 +65,11 @@ class Scene1 implements Scene { this.parent = parent; } - public void setupScene() { // Specific scene setup, if necessary println("Scene1 setup completed."); } - public void sceneRender(PGraphics pg) { pg.ambientLight(128, 128, 128); // Add ambient light pg.pushMatrix(); @@ -95,24 +94,16 @@ class Scene1 implements Scene { pg.popMatrix(); } - public void keyPressed(char key) { // Implement key response logic, if necessary println("Key pressed in Scene1: " + key); } - - public void mouseEvent(int mouseX, int mouseY, int button) { + public void mouseEvent(MouseEvent event) { // Implement mouse event logic, if necessary - println("Mouse event in Scene1: " + mouseX + ", " + mouseY + ", button: " + button); } } -// Forward control events to the library -void controlEvent(controlP5.ControlEvent theEvent) { - ziviDome.controlEvent(theEvent); -} - // Implementation of Scene2 that uses the Scene interface class Scene2 implements Scene { zividomelive parent; @@ -121,12 +112,10 @@ class Scene2 implements Scene { this.parent = parent; } - public void setupScene() { // Specific scene settings, if necessary } - public void sceneRender(PGraphics pg) { pg.pushMatrix(); pg.background(25, 25, 112); @@ -137,15 +126,12 @@ class Scene2 implements Scene { pg.popMatrix(); } - public void keyPressed(char key) { // Implement key response logic, if necessary } - - public void mouseEvent(int mouseX, int mouseY, int button) { + public void mouseEvent(MouseEvent event) { // Implement mouse event logic, if necessary - println("Mouse event in Scene2: " + mouseX + ", " + mouseY + ", button: " + button); } void drawLabeledBox(PGraphics pg, float size) { diff --git a/examples/EmptyProject/EmptyProject b/examples/EmptyProject/EmptyProject.pde similarity index 97% rename from examples/EmptyProject/EmptyProject rename to examples/EmptyProject/EmptyProject.pde index a10ef4b..65fb48c 100644 --- a/examples/EmptyProject/EmptyProject +++ b/examples/EmptyProject/EmptyProject.pde @@ -57,22 +57,22 @@ class Scene1 implements Scene { this.parent = parent; } - @Override + public void setupScene() { // Specific scene setup, if necessary } - @Override + public void sceneRender(PGraphics pg) { // Scene rendering logic } - @Override + public void keyPressed(char key) { // Key response logic } - @Override + public void mouseEvent(MouseEvent event) { // Mouse event logic } diff --git a/examples/MouseParticle/MouseParticle.pde b/examples/SphereParticle/SphereParticle.pde similarity index 98% rename from examples/MouseParticle/MouseParticle.pde rename to examples/SphereParticle/SphereParticle.pde index b797c4c..3119430 100644 --- a/examples/MouseParticle/MouseParticle.pde +++ b/examples/SphereParticle/SphereParticle.pde @@ -49,7 +49,7 @@ void controlEvent(controlP5.ControlEvent theEvent) { ziviDome.controlEvent(theEvent); } -// Implementation of Scene1 that uses the Scene interface +// Implementation of Scene that uses the Scene interface class Scene1 implements Scene { zividomelive parent; PGraphics pg; @@ -74,13 +74,11 @@ class Scene1 implements Scene { birthTime = new ArrayList(); } - @Override public void setupScene() { noStroke(); fill(64, 255, 255, 192); // Set fill color for particles } - @Override public void sceneRender(PGraphics pg) { pg.beginDraw(); pg.background(32); @@ -150,12 +148,10 @@ class Scene1 implements Scene { pg.endDraw(); } - @Override public void keyPressed(char key) { // Key response logic } - @Override public void mouseEvent(MouseEvent event) { if (event.getAction() == MouseEvent.PRESS || event.getAction() == MouseEvent.DRAG) { addNewParticle((event.getX())*0.1, (event.getY())*0.1);