(function() { "use strict"; var PreloadScene = function() { this.initialize(); } var p = PreloadScene.prototype = new creatine.Scene(); p.textLoading = null; p.progressBar = null; p.Scene_initialize = p.initialize; p.initialize = function() { this.Scene_initialize(); this.textLoading = new createjs.Text('Loading...', '18px montserrat', '#f3f3f3'); var bounds = this.textLoading.getBounds(); this.textLoading.x = canvas.width/2 - bounds.width/2; this.textLoading.y = canvas.height/2 - bounds.height/2; this.progressBar = new creatine.ProgressBar( '#fbb829', '#026475', null, canvas.width, 5, 0, 1 ); this.progressBar.x = 0; this.progressBar.y = canvas.height/2 + bounds.height/2 + 5; this.addChild(this.textLoading); this.addChild(this.progressBar); var _this = this; loader.addEventListener('progress', function(event) { _this.onProgress(event); }); this.on('sceneexit', function() { _this.removeAllChildren(); }); } p.onProgress = function(event) { this.progressBar.value = event.progress; } p.onUpdate = function(event) { } window.PreloadScene = PreloadScene; }());