public class Stage
extends java.lang.Object
Constructor and Description |
---|
Stage(GWindow window)
Create a new, empty stage, on the given window.
|
Modifier and Type | Method and Description |
---|---|
void |
addActor(Actor actor)
Add a new actor to the stage.
|
void |
addProp(Prop prop)
Add a new prop to the stage.
|
void |
animate()
Run rounds of animation forever.
|
void |
animate(int times)
Run a certain number of rounds of animation.
|
void |
animateInBackground()
Run rounds of animation forever, in the background.
|
void |
animateOneRound()
Run one round of the animation.
|
void |
close()
End the animation and close the GWindow
|
java.util.ArrayList |
getActors()
Return a list of all the actors.
|
int |
getHeight()
Return the height of the stage window.
|
java.util.ArrayList |
getProps()
Return a list of all the props.
|
int |
getTimeForOneRound()
Get the current amount of time to pause between rounds of
animation, in ms.
|
int |
getWidth()
Return the width of the stage window.
|
GWindow |
getWindow()
Return the window of the stage.
|
void |
makeAnimationRoundsAtomic()
Make each round of animation "atomic", in that only after all
the doAction operations are done, and all the graphic changes
are made, will the final updated scene be displayed.
|
void |
quitAnimation()
Quit the animation loop, if it's running.
|
void |
quitWhenWindowClosed()
Make it so that the whole animation application will exit when
the stage's window is closed.
|
void |
registerEventHandler(GWindowEventHandler handler)
Register the handler object that should be notified if there are
any input events (e.g., key or mouse button pressed or
released).
|
void |
removeActor(Actor actor)
Remove an actor from the stage.
|
void |
removeProp(Prop prop)
Remove a prop from the stage.
|
void |
resumeAnimation()
Resume the animation loop, if was suspended.
|
void |
resumeTimerEvents()
Resume delivering timer events at the previous rate, if they
were enabled.
|
void |
setTimeForOneRound(int newTime)
Set the amount of time to pause between rounds of animation, in
ms.
|
void |
startTimerEvents(int interval)
Start delivering timer events to the registered event handler.
|
void |
stopTimerEvents()
Stop delivering timer events to the registered event handler.
|
void |
suspendAnimation()
Suspend the animation loop, if it's running.
|
public Stage(GWindow window)
public GWindow getWindow()
public int getWidth()
public int getHeight()
public void makeAnimationRoundsAtomic()
public void addActor(Actor actor)
public void addProp(Prop prop)
public void removeActor(Actor actor)
public void removeProp(Prop prop)
public java.util.ArrayList getActors()
public java.util.ArrayList getProps()
public int getTimeForOneRound()
public void setTimeForOneRound(int newTime)
public void registerEventHandler(GWindowEventHandler handler)
public void startTimerEvents(int interval)
interval
- the interval in milliseconds between timerExpired events.public void stopTimerEvents()
public void resumeTimerEvents()
public void quitWhenWindowClosed()
public void animateOneRound()
public void animate()
public void animateInBackground()
public void animate(int times)
times
- the number of rounds to run.public void quitAnimation()
public void suspendAnimation()
public void resumeAnimation()
public void close()