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

◆ addListener()

void addListener ( PreloadListener  listener)

Add listener.

◆ checkFinished()

void checkFinished ( )

Check if preloading finished.

If finished calls finish() and notifyAllResourcesFinished().

◆ finishPreloading()

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.

◆ getFinishedResourceCount()

int getFinishedResourceCount ( )

Number of finished resources.

◆ getPreloading()

bool getPreloading ( )

◆ getSuccess()

bool getSuccess ( )

All resources preloaded successfully.

◆ getTotalResourceCount()

int getTotalResourceCount ( )

Total number of resources to preload.

◆ incrementTotalResourceCount()

void incrementTotalResourceCount ( )

Increment total resource count by one.

◆ new()

Preloader new ( )

Create preloader.

◆ notifyAllPreloadingFinished()

void notifyAllPreloadingFinished ( )

Notify listeners preloading finished.

◆ notifyAllResourcesFinished()

void notifyAllResourcesFinished ( )

Notify listeners resources finished preloading.

◆ percentageFinished()

float percentageFinished ( )

Percentage of resources finished preloading.

◆ removeListener()

void removeListener ( PreloadListener  listener)

Remove listener.

◆ resourceFinished()

void resourceFinished ( bool  success)

Resource finished preloading.


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