(function() { "use strict"; var CreditsScene = function() { this.initialize(); } var p = CreditsScene.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_menu')); this.title = new createjs.Bitmap(loader.getResult('img_credits')); this.title.x = 424; this.title.y = 130; this.buttonBack = createButton(140, 40, 'Back'); this.buttonBack.x = 90; this.buttonBack.y = 556; this.buttonGuineaLink = new createjs.Text('http://guineashots.com', '24px sweetlove', '#6D4419'); var AUTHOR = 'Renato de Pontes Pereira'; var CREDITS = ''+ 'Everybody wants a person to share a life, to found ' + 'a family, to fall in love, to marry, etc; and when ' + 'this happen, one person connects its own world to ' + 'the other. \n'+ 'This game was create for Ludum dare #30, in 48 hours ' + 'under the theme "Connected World". I hope you enjoy!\n'; this.txtAuthor = new createjs.Text('by '+AUTHOR, '24px sweetlove', '#6D4419'); // this.txtAuthor.textAlign = 'right'; this.txtAuthor.lineWidth = canvas.width/1.5; this.txtCredits = new createjs.Text(CREDITS, '22px Arial', '#6D4419'); // this.txtCredits.textAlign = 'justify'; this.txtCredits.lineWidth = canvas.width/1.5; var area = {x:0, y:0, width:canvas.width, height:canvas.height} var vbox = new creatine.BoxSizer(creatine.VERTICAL, area); vbox.add({}, 14, 0); vbox.add(this.txtCredits, 3, 0, creatine.CENTER); vbox.add({}, 2, 0); // vbox.add(this.buttonBack, 1, 0, creatine.CENTER); vbox.add(this.txtAuthor, 1, 0, creatine.CENTER); vbox.add(this.buttonGuineaLink, 1, 0, creatine.CENTER); vbox.add({}, 8, 0); vbox.layout(); this.txtAuthor.x += 120; this.buttonGuineaLink.x += 150; // add objects to scene this.addChild(this.background); this.addChild(this.title); this.addChild(this.buttonBack); this.addChild(this.txtAuthor); this.addChild(this.txtCredits); this.addChild(this.buttonGuineaLink); // register events this.on('sceneenter', this.onSceneEnter); this.on('sceneresume', this.onSceneResume); this.on('scenepause', this.onScenePause); } p.registerEvents = function(event) { 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.buttonBack.removeAllEventListeners('click'); this.txtAuthor.removeAllEventListeners('click'); this.buttonGuineaLink.removeAllEventListeners('click'); } 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.CreditsScene = CreditsScene; }());