|
PulpCore | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object pulpcore.scene.Scene
public abstract class Scene
A Scene is an object that updates the display and handles input from the user. All PulpCore apps will implement a Scene.
A typical game will have several Scenes: for example, a title scene, menu scene, main game scene, high score scene, help scene, etc.
For Applets, the first Scene is defined by the "scene" applet parameter:
<param name="scene" value="MyFirstScene" />
The Stage
is responsible for invoking the
Scene's methods, with the exception of reload()
.
Stage.setScene(Scene)
,
Stage.replaceScene(Scene)
,
Stage.pushScene(Scene)
,
Stage.popScene()
Constructor Summary | |
---|---|
Scene()
|
Method Summary | |
---|---|
abstract void |
drawScene(CoreGraphics g)
Draws to the surface's graphics context. |
void |
hideNotify()
Notifies that this scene has been hidden by another Scene or immediately before a call to stop(). |
void |
load()
Performs any actions needed to load this scene. |
void |
redrawNotify()
Notifies that this scene that the Stage or the OS has requested a full redraw. |
void |
reload()
Reloads the scene. |
void |
showNotify()
Notifies that this scene has been shown after another Scene is hidden or immediately after a call to start(). |
void |
unload()
Performs any actions needed to unload this scene. |
abstract void |
updateScene(int elapsedTime)
Updates the scene. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Scene()
Method Detail |
---|
public void load()
public void unload()
public void reload()
unload()
followed by load()
.
public void showNotify()
public void hideNotify()
public void redrawNotify()
public abstract void updateScene(int elapsedTime)
Stage
while this Scene is active. A scene will typically update
sprites and handle input.
When a Scene is first shown (after a call to showNotify), the elapsedTime is zero.
The Stage starts a synchronized block on this Scene before calling this method and ends
the block after drawScene(CoreGraphics)
returns.
elapsedTime
- time, in milliseconds, since the last call to updateScene().public abstract void drawScene(CoreGraphics g)
updateScene(int)
.
The Stage starts a synchronized block on this Scene before calling
updateScene(int)
and ends the block after this method returns.
g
- the CoreGraphics object to draw to. The CoreGraphics clip is
set to the entire display area.
|
PulpCore | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |