This repository was archived by the owner on Sep 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Creating a New Scene
Asher edited this page Oct 27, 2020
·
1 revision
Optionally, create a new package inside of src.Gprocessing
.
If you created a new package, create a new class inside of that, otherwise, create the new class directly inside of src.Gprocessing
.
package path.to.class;
public class ExampleNewScene extends Scene {
public static void main (String[] args) {
Engine.init(1600, 900, "Hello World!");
}
public void awake() {
camera = new Camera();
}
public void update() {
// Clear color RGB (0 - 255)
background(255, 255, 255);
}
}
Look for the class Gprocessing.Window
, inside you will see these variables defined at the top:
// Define and set the current scene
public static Main main = new Main();
public static Scene currentScene = main;
Declare and define the new class that you previously declared eg.
public static ExampleNewScene newScene = new ExampleNewScene();
then set currentScene
equal to your new scene
public static Scene currentScene = newScene;
Set your IDE's main class to ExampleNewScene.java
(or whatever you named it), and run.