(function() { "use strict"; var Button = function(text) { this.initialize(text); } var p = Button.prototype = new createjs.Container(); p._cccc = p.initialize; p.initialize = function(text) { this._cccc(); this.background = new createjs.Bitmap(loader.getResult('img_button')); var bounds = this.background.getBounds(); // this.regY = bounds.height/2; this.text = new createjs.Text(text, '24px sheep', '#FFF'); this.text.textAlign = 'center'; this.text.x = bounds.width/2; this.text.y = bounds.height/4; this.addChild(this.background); this.addChild(this.text); } window.Button = Button; })();