Package nl.colorize.multimedialib.stage
Class Stage
java.lang.Object
nl.colorize.multimedialib.stage.Stage
- All Implemented Interfaces:
Updatable
The stage contains all graphics that are part of the current scene.
Depending on the renderer and current platform, the stage can contain
2D and/or 3D graphics. The stage is structured as a
scene graph,
and can be traversed using a
StageVisitor
. This is used by the
renderer at the end of each frame update, so the stage can be rendered.
While the scene has full control over the stage, this control cannot outlive the scene itself: at the end of the scene the contents of the stage are cleared so the next scene can take over.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCreates a new container, then adds it to the root of the scene graph.addContainer
(String name) Creates a new container with the specified name, then adds it to the root of the scene graph.void
clear()
Removes all 2D and 3D graphics from the stage.getRoot()
getWorld()
void
setBackgroundColor
(ColorRGB backgroundColor) toString()
Returns a textual representation of the stage's current contents, which can be used for testing and debugging purposes.void
update
(float deltaTime) Updates this object for the current frame.void
visit
(StageVisitor visitor) Visits all graphics currently on the stage, in the order in which they should be drawn.
-
Constructor Details
-
Stage
-
-
Method Details
-
update
public void update(float deltaTime) Description copied from interface:Updatable
Updates this object for the current frame.deltaTime
indicates the elapsed time since the last frame update, in seconds. -
addContainer
Creates a new container, then adds it to the root of the scene graph. Returns the container that was just created. This is a convenience method to easily create top-level containers. -
addContainer
Creates a new container with the specified name, then adds it to the root of the scene graph. Returns the container that was just created. This is a convenience method to easily create top-level containers. -
visit
Visits all graphics currently on the stage, in the order in which they should be drawn. This method is called by the renderer following each frame update. -
clear
public void clear()Removes all 2D and 3D graphics from the stage. This is always called at the end of a scene, but can also be used manually mid-scene. -
toString
Returns a textual representation of the stage's current contents, which can be used for testing and debugging purposes. -
getCanvas
-
getFrameStats
-
getRoot
-
getWorld
-
getBackgroundColor
-
setBackgroundColor
-