Drag[en]gine Script Module DragonScript  1.23
Dragengine.Preloading.Preloader Class Reference

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

Inheritance diagram for Dragengine.Preloading.Preloader:
Dragengine.Audio.Announcer.PreloadAnnouncer Dragengine.Audio.DynamicMusic.PreloadDynamicMusic

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.

Member Function Documentation

◆ addListener()

void Dragengine.Preloading.Preloader.addListener ( PreloadListener  listener)

Add listener.

◆ checkFinished()

void Dragengine.Preloading.Preloader.checkFinished ( )

Check if preloading finished.

If finished calls finish() and notifyAllResourcesFinished().

◆ finishPreloading()

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.

◆ getCounter()

PreloadCounter Dragengine.Preloading.Preloader.getCounter ( )

Preload counter.

◆ getPreloading()

bool Dragengine.Preloading.Preloader.getPreloading ( )

◆ getSuccess()

bool Dragengine.Preloading.Preloader.getSuccess ( )

All resources preloaded successfully.

◆ getTotalResourceCount()

int Dragengine.Preloading.Preloader.getTotalResourceCount ( )

Total number of resources to preload.

◆ new()

Preloader Dragengine.Preloading.Preloader.new ( PreloadCounter  parentCounter)

Create preloader.

◆ notifyAllPreloadingFinished()

void Dragengine.Preloading.Preloader.notifyAllPreloadingFinished ( )

Notify listeners preloading finished.

◆ notifyAllResourcesFinished()

void Dragengine.Preloading.Preloader.notifyAllResourcesFinished ( )

Notify listeners resources finished preloading.

◆ percentageFinished()

float Dragengine.Preloading.Preloader.percentageFinished ( )

Percentage of resources finished preloading.

◆ removeListener()

void Dragengine.Preloading.Preloader.removeListener ( PreloadListener  listener)

Remove listener.

◆ resourceFinished()

void Dragengine.Preloading.Preloader.resourceFinished ( bool  success)

Resource finished preloading.


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