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

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...
 

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.

Author
Roland Pl├╝ss
Version
1.0
Date
2015

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.

◆ getCounter()

PreloadCounter getCounter ( )

Preload counter.

◆ getPreloading()

bool getPreloading ( )

◆ getSuccess()

bool getSuccess ( )

All resources preloaded successfully.

◆ getTotalResourceCount()

int getTotalResourceCount ( )

Total number of resources to preload.

◆ new()

Preloader new ( PreloadCounter  parentCounter)

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: