Class Stage

java.lang.Object
buildengine.engine.stage.Stage

public class Stage extends Object
Stage holding the current scene. The stage also holds a TransitionRenderer, which can be customised. The Stage is responsible for all the functionality, like updating and rendering all components of a scene. It also holds a music object for music :).
See Also:
  • Constructor Details

    • Stage

      public Stage(TransitionRenderer transitionRenderer)
      Creates a new stage instance with no scene.
      Parameters:
      transitionRenderer - The transition renderer to be used for scene transition.
      See Also:
    • Stage

      public Stage(Scene scene)
      Creates a new stage instance with the default transition renderer and loads a scene.
      Parameters:
      scene - The scene to be loaded
      See Also:
  • Method Details

    • loadScene

      public void loadScene(Scene newScene)
      Load a new stage. This stage will replace the old one. This methods creates the transition thread, in witch the old state is cleaned up and the new state is initialized. After this process is complete it switches states.
      Parameters:
      newScene - The state to be loaded and set
    • begin

      public void begin()
    • update

      public void update()
    • fixedUpdate

      public void fixedUpdate()
    • render

      public void render()
    • cleanUp

      public void cleanUp()
    • getScene

      public Scene getScene()
    • getCursorPosition

      public Vector2f getCursorPosition()
      Gets the cursor position relative to the stage. Keep in mind, stage is static, and the center point will always be vec(0,0). To get the mouse position relative to the scene (taking the camera into account) use the respective method in the Scene class.
      Returns:
      The cursor position relative to the stage.
      See Also:
    • getMusic

      public Music getMusic()
    • getTransitionRenderer

      public TransitionRenderer getTransitionRenderer()
    • setTransitionRenderer

      public void setTransitionRenderer(TransitionRenderer transitionRenderer)