Package buildengine.engine.stage
Class Stage
java.lang.Object
buildengine.engine.stage.Stage
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 Summary
ConstructorDescriptionStage
(TransitionRenderer transitionRenderer) Creates a new stage instance with no scene.Creates a new stage instance with the default transition renderer and loads a scene. -
Method Summary
Modifier and TypeMethodDescriptionvoid
begin()
void
cleanUp()
void
Gets the cursor position relative to the stage.getMusic()
getScene()
void
Load a new stage.void
render()
void
setTransitionRenderer
(TransitionRenderer transitionRenderer) void
update()
-
Constructor Details
-
Stage
Creates a new stage instance with no scene.- Parameters:
transitionRenderer
- The transition renderer to be used for scene transition.- See Also:
-
Stage
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
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
-
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
-
getTransitionRenderer
-
setTransitionRenderer
-