Drag[en]gine Script Module DragonScript Script API  1.0
Preloader Class Reference

Preloads multiple resources for one or more objects. More...

Inheritance diagram for Preloader:
PreloadAnnouncer PreloadDynamicMusic PreloadVoice


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...
int getFinishedResourceCount ()
 Number of finished resources. More...
bool getPreloading ()
 Preloading. More...
bool getSuccess ()
 All resources preloaded successfully. More...
int getTotalResourceCount ()
 Total number of resources to preload. More...
void incrementTotalResourceCount ()
 Increment total resource count by one. More...
Preloader new ()
 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...

Detailed Description

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.

Roland Pl├╝ss

Member Function Documentation

void addListener ( PreloadListener  listener)

Add listener.

void checkFinished ( )

Check if preloading finished.

If finished calls finish() and notifyAllResourcesFinished().

void finishPreloading ( )

Finish preloading.

Implement in subclass to ready preloaded object(s) for use if required. See getSuccess() to see if preloading succeeded or not.

int getFinishedResourceCount ( )

Number of finished resources.

bool getPreloading ( )
bool getSuccess ( )

All resources preloaded successfully.

int getTotalResourceCount ( )

Total number of resources to preload.

void incrementTotalResourceCount ( )

Increment total resource count by one.

Preloader new ( )

Create preloader.

void notifyAllPreloadingFinished ( )

Notify listeners preloading finished.

void notifyAllResourcesFinished ( )

Notify listeners resources finished preloading.

float percentageFinished ( )

Percentage of resources finished preloading.

void removeListener ( PreloadListener  listener)

Remove listener.

void resourceFinished ( bool  success)

Resource finished preloading.


The documentation for this class was generated from the following file: