(function() { "use strict"; var CreditsScene = function() { this.initialize(); } var p = CreditsScene.prototype = new creatine.Scene(); p.Scene_initialize = p.initialize; p.ship = null; p.initialize = function() { this.Scene_initialize(); this.ship = new createjs.Bitmap(loader.getResult('ship')); this.ship.regX = this.ship.image.width/2; this.ship.regY = this.ship.image.height/2; this.ship.x = canvas.width/2; this.ship.y = 135; this.addChild(this.ship); this.shadow = new createjs.Bitmap(loader.getResult('shadow')); this.shadow.y = 150; this.addChild(this.shadow); this.txtTitle = new createjs.Text(TITLE, '36px montserrat', SCREEN_TEXT_DARKCOLOR); this.txtTitle.textAlign = 'center'; this.txtTitle.lineWidth = canvas.width-100; this.addChild(this.txtTitle); this.txtAuthor = new createjs.Text('by '+AUTHOR, '24px montserrat', SCREEN_TEXT_LIGHTCOLOR); this.txtAuthor.textAlign = 'center'; this.txtAuthor.lineWidth = canvas.width-100; this.addChild(this.txtAuthor); this.txtCredits = new createjs.Text(CREDITS, '12px montserrat-regular', SCREEN_TEXT_LIGHTCOLOR); this.txtCredits.textAlign = 'center'; this.txtCredits.lineWidth = canvas.width-100; this.addChild(this.txtCredits); this.buttonBack = new createjs.Bitmap(loader.getResult('button_back')); this.buttonBack.on('click', this.onButtonBack, this); this.addChild(this.buttonBack); this.buttonGuineaLink = new createjs.Text('http://guineashots.com', '16px montserrat', SCREEN_TEXT_LIGHTCOLOR); this.buttonGuineaLink.textAlign = 'center'; this.buttonGuineaLink.on('click', this.onGuineaLink, this); this.addChild(this.buttonGuineaLink); var area = {x:0, y:0, width:canvas.width, height:canvas.height} var vbox = new creatine.BoxSizer(creatine.VERTICAL, area); vbox.add({}, 6, 0); vbox.add(this.txtTitle, 2, 0, creatine.CENTER); vbox.add(this.txtAuthor, 2, 0, creatine.CENTER); vbox.add({}, 1, 0); vbox.add(this.txtCredits, 4, 0, creatine.CENTER); vbox.add({}, 1, 0); vbox.add(this.buttonBack, 1, 0, creatine.CENTER); vbox.add({}, 1, 0); vbox.add(this.buttonGuineaLink, 1, 25, creatine.BOTTOM); vbox.layout(); var hc = canvas.width/2; this.txtTitle.x = hc; this.txtAuthor.x = hc; this.txtCredits.x = hc; this.buttonGuineaLink.x = hc; } p.onUpdate = function(event) { } p.onButtonBack = function(event) { this.buttonBack.removeAllEventListeners('click'); director.replace( new MenuScene(), new creatine.transitions.Scroll( creatine.RIGHT, createjs.Ease.cubicInOut, 800 ) ) } p.onGuineaLink = function(event) { window.open('http://guineashots.com','_blank'); } window.CreditsScene = CreditsScene; }());