踢足球
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

47 lines
915 B

/**
* 演示模式类
* @property {object} lib 库对象
* @property {object} stopDemo 面板元素对象
*/
function Demo() {
this.lib = library;
this.stopDemo = null;
}
Demo.of = (function () {
let instance = null;
return function () {
if (!instance) {
instance = new Demo();
}
instance.init();
return instance;
};
})();
// 初始化
Demo.prototype.init = function () {
this.showStopDemo();
};
// 显示演示模式按钮
Demo.prototype.showStopDemo = function () {
const lib = this.lib;
const stopDemo = new lib.stopDemo();
stopDemo.x = 50;
stopDemo.y = lib.properties.height - 100;
this.stopDemo = stopDemo;
// 关闭演示模式
this.stopDemo.addEventListener(
'click',
function () {
stage.removeChild(stopDemo);
location.hash = '';
location.reload();
isDemo = false;
},
false,
);
stage.addChild(stopDemo);
};