ImageLoader v0.1

by Nicolas Clavaud, 31 jan. 2008

Helps loading JPG, GIF and PNG in other threads and checking the loading completion.

Constructor
===========

Syntax
------
ImageLoader(PApplet parent, String url);
ImageLoader(PApplet parent, String[] urls);

Parameters
----------
parent    PApplet : typically use "this"
url       String : URL designing the image to load
urls      String[] : array of URLs designing the images to load


Methods
=======

void start() : starts loading the image(s)
boolean isAlive() : returns true while it is busy, false if the download is done
PImage getImage(int i)
PImage[] getImages()
int getCurrentImageNumber() : between 1 and the number of images to load
int getTotalImageNumber() : the number of images to load
float getCurrentProgression() : between 0 and 1
float getTotalProgression() : between 0 and 1

Events
======

imageLoadingComplete(ImageLoader imageLoader) : is called when the downloads are complete

Typically used to retrieve the images once they are loaded :
void imageLoadingComplete(ImageLoader il) {
  myImage1 = il.getImage(0);
  myImage2 = il.getImage(1);
}
