imageloader v0.3

by Nicolas Clavaud, 2008/08/05

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 addImage(String url) : add another image to the loading queue (before you start loading the images only!)
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);
}

Improvements since v0.2
=======================

- imageLoadingComplete() were called after each image has loaded
- addImage(String url) does now allow to add another image to the loading queue

Fixed bugs since v0.1
=====================

- recompiled with JDK 1.4 for higher compatibility
- filenames in lower case for linux compatibility