(function() { "use strict"; var PreTutorialScene = function() { this.initialize(); } var p = PreTutorialScene.prototype = new creatine.Scene(); p.Scene_initialize = p.initialize; p.initialize = function() { this.Scene_initialize(); // initialize objects this.background = new createjs.Bitmap(loader.getResult('img_pretutorial')); this.text = new createjs.Text('Click anyewhere to continue.', '32px sweetlove', '#6D4419'); this.text.textAlign = 'center'; this.text.x = canvas.width/2; this.text.y = canvas.height-50; // add objects to scene this.addChild(this.background); this.addChild(this.text); // register events this.on('sceneenter', this.onSceneEnter); this.on('sceneresume', this.onSceneResume); this.on('scenepause', this.onScenePause); } p.registerEvents = function(event) { this.on('click', this.onClick); // this.buttonBack.on('click', this.onButtonBack, this); // this.txtAuthor.on('click', this.onGuineaLink, this); // this.buttonGuineaLink.on('click', this.onGuineaLink, this); } p.unregisterEvents = function(event) { this.removeAllEventListeners('click'); // this.txtAuthor.removeAllEventListeners('click'); // this.buttonGuineaLink.removeAllEventListeners('click'); } p.onClick = function(event) { director.replace( new TutorialScene(), new creatine.transitions.Scroll(creatine.TOP) ) } p.onUpdate = function(event) { } p.onSceneEnter = function(event) { this.registerEvents(); } p.onSceneResume = function(event) { this.registerEvents(); } p.onScenePause = function(event) { this.unregisterEvents(); } p.onGuineaLink = function(event) { window.open('http://guineashots.com','_blank'); } p.onButtonBack = function(event) { director.pop( new creatine.transitions.Scroll(creatine.RIGHT) ); } window.PreTutorialScene = PreTutorialScene; }());