1 decade ago by John
Is there any way to dynamically unload a resource e.g. image / level after it's been loaded?
This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact
// If you were to load an image like this... // Load an image var img = new ig.Image( 'player.png' ); // Then you'd want to unset the variable // something like this... img = null; // Also, the image will be in // ig.resources (an array). // You'll want to splice it out. // Also, the ig.Image object // is being held in // ig.Image.cache (an object). // You'll want to delete it from // there too.
delete backgroundMap.tiles; delete ig.Image.cache['media/foo.png']; delete LevelFooResources;