Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by devhyfes

Hi,

How do callbacks work on the ig.Image? I am creating an Image subclass that takes a couple of images then uses their drawTile method to create a new image. In order for that to work, it needs to know that the images have loaded prior to using them.

Is there a callback from ig.Images, similar to the onload function for the regular Image object?

1 decade ago by dominic

ig.Image has an (undocumented) onload method where you could do some additional processing:

MyImageClass = ig.Image.extend({
	onload: function( event ) {
		this.parent( event );
	}
});

Or you subclass the ig.Loader and do your work after all assets have been loaded in its end() method. Have a look at the Drop source code for an example - the DropLoader modifies all images when everything is loaded.


The loadCallback for images is only used internally by the preloader.
Page 1 of 1
« first « previous next › last »