Loading screen

How to set a loading image to show while WADE is loading data

When you ask WADE to load data synchronously (i.e. blocking the normal flow of the app), you can decide to show one ore more images on the screen to let your users know about it. This is done throug wade.setLoadingImages(). You can use a single string, or an array of strings. The images that you use here don't need to be loaded with wade.loadImage().
App = function() { var largePicture = 'http://upload.wikimedia.org/wikipedia/commons/d/db/Barley_field-2007-02-22(large).jpg'; this.load = function() { // set a loading image (you could use an array of images too) wade.setLoadingImages('/snippets/samples/loading.jpg'); // load a large picture wade.loadImage(largePicture); }; this.init = function() { // create an object wade.addSceneObject(new SceneObject(new Sprite(largePicture))); }; };
Your code was executed successfully!