Drag[en]gine Script Module DragonScript
1.23
|
Preloads multiple resources for one or more objects. More...
Classes | |
class | ResourceFinishedListener |
Listener used by preloaded resources. More... | |
Public Member Functions | |
void | addListener (PreloadListener listener) |
Add listener. More... | |
void | checkFinished () |
Check if preloading finished. More... | |
void | finishPreloading () |
Finish preloading. More... | |
PreloadCounter | getCounter () |
Preload counter. More... | |
bool | getPreloading () |
Preloading. More... | |
bool | getSuccess () |
All resources preloaded successfully. More... | |
int | getTotalResourceCount () |
Total number of resources to preload. More... | |
Preloader | new (PreloadCounter parentCounter) |
Create preloader. More... | |
void | notifyAllPreloadingFinished () |
Notify listeners preloading finished. More... | |
void | notifyAllResourcesFinished () |
Notify listeners resources finished preloading. More... | |
float | percentageFinished () |
Percentage of resources finished preloading. More... | |
void | removeListener (PreloadListener listener) |
Remove listener. More... | |
void | resourceFinished (bool success) |
Resource finished preloading. More... | |
Preloads multiple resources for one or more objects.
To use create preloader create preloader instance and preload resources using ResourceFinishedListener subclass as resource listener. Add preload listener to be notified when all resources finished preloading. Call checkFinished() in case no resources have been started preloading or all resources are already loaded. As soon as all resources have been finished the preloader listener is called.
void Dragengine.Preloading.Preloader.addListener | ( | PreloadListener | listener | ) |
Add listener.
void Dragengine.Preloading.Preloader.checkFinished | ( | ) |
Check if preloading finished.
If finished calls finish() and notifyAllResourcesFinished().
void Dragengine.Preloading.Preloader.finishPreloading | ( | ) |
Finish preloading.
Implement in subclass to ready preloaded object(s) for use if required. See getSuccess() to see if preloading succeeded or not.
Reimplemented in Dragengine.Audio.DynamicMusic.PreloadDynamicMusic, and Dragengine.Audio.Announcer.PreloadAnnouncer.
PreloadCounter Dragengine.Preloading.Preloader.getCounter | ( | ) |
Preload counter.
bool Dragengine.Preloading.Preloader.getPreloading | ( | ) |
bool Dragengine.Preloading.Preloader.getSuccess | ( | ) |
All resources preloaded successfully.
int Dragengine.Preloading.Preloader.getTotalResourceCount | ( | ) |
Total number of resources to preload.
Preloader Dragengine.Preloading.Preloader.new | ( | PreloadCounter | parentCounter | ) |
Create preloader.
void Dragengine.Preloading.Preloader.notifyAllPreloadingFinished | ( | ) |
Notify listeners preloading finished.
void Dragengine.Preloading.Preloader.notifyAllResourcesFinished | ( | ) |
Notify listeners resources finished preloading.
float Dragengine.Preloading.Preloader.percentageFinished | ( | ) |
Percentage of resources finished preloading.
void Dragengine.Preloading.Preloader.removeListener | ( | PreloadListener | listener | ) |
Remove listener.
void Dragengine.Preloading.Preloader.resourceFinished | ( | bool | success | ) |
Resource finished preloading.