function Back() { this.lib = library; this.back = null; } Back.of = function () { const instance = new Back(); instance.init(); return instance; }; Back.prototype.init = function () { const target = new this.lib.btnBack(); target.x = 40; target.y = 80; target.scaleX = 1.3; target.scaleY = 1.3; target.addEventListener('click', this.goHome, false); this.back = target; stage.addChild(target); }; // 返回主菜单 TODO: Back.prototype.goHome = function () { console.log('goHome'); };