|
PulpCore | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object pulpcore.scene.Scene pulpcore.scene.Scene2D pulpcore.scene.LoadingScene
public class LoadingScene
A scene that downloads the asset catalog file (zip file). It automatically handles download errors by allowing the user to retry a failed download.
The default implementation creates a solid-colored background with a progress bar in
the middle of the stage. Subclasses can change this appearance by invoking
getMainLayer().removeAll()
and adding other visual elements.
Constructor Summary | |
---|---|
LoadingScene(String assetCatalogFile)
|
|
LoadingScene(String assetCatalogFile,
Scene nextScene)
|
|
LoadingScene(String assetCatalogFile,
Scene nextScene,
int backgroundColor,
CoreFont font)
|
Method Summary | |
---|---|
double |
getProgress()
Returns a value from 0 to 1. |
void |
load()
Performs any actions needed to load this scene. |
void |
onCompletion(Timeline timeline)
Sets the timeline to start once the download is complete. |
void |
setErrorMessage(String message,
String retryButtonText)
|
boolean |
shouldProgressBeVisible()
|
void |
unload()
Forces all invokeAndWait() and addEventAndWait() calls to return, and removes all layers, sprites, and timelines. |
void |
update(int elapsedTime)
Subclasses should call super.update() to handing downloading success and error. |
Methods inherited from class pulpcore.scene.Scene2D |
---|
add, addEvent, addEventAndWait, addLayer, addTimeline, drawScene, getCursor, getMainLayer, getMaxElapsedTime, getNumSprites, getNumTimelines, getNumVisibleSprites, hideNotify, invokeAndWait, invokeLater, isDirtyRectanglesEnabled, isPaused, redrawNotify, remove, removeAllTimelines, removeLayer, removeTimeline, setCursor, setDirtyRectanglesEnabled, setMaxElapsedTime, setPaused, showNotify, updateScene |
Methods inherited from class pulpcore.scene.Scene |
---|
reload |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LoadingScene(String assetCatalogFile)
public LoadingScene(String assetCatalogFile, Scene nextScene)
public LoadingScene(String assetCatalogFile, Scene nextScene, int backgroundColor, CoreFont font)
Method Detail |
---|
public void onCompletion(Timeline timeline)
public void setErrorMessage(String message, String retryButtonText)
public void load()
Scene
load
in class Scene
public void unload()
Scene2D
unload
in class Scene2D
public void update(int elapsedTime)
update
in class Scene2D
public boolean shouldProgressBeVisible()
public double getProgress()
|
PulpCore | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |