【发布时间】:2017-08-07 15:02:19
【问题描述】:
我想在游戏中添加弹出窗口。我正在使用移相器并发现 modal.js 用于在移相器中添加弹出窗口似乎很有用,但是当我尝试添加它时,我收到错误“未捕获的 TypeError:无法设置未定义的属性 'modal1'”。我想我得到这个错误只是因为我的编码结构。这是我的代码
var reg={};
createModals: function(){
reg.modal.createModal({
type: "modal1",
includeBackground: true,
modalCloseOnInput: true,
itemsArr: [{
type: "graphics",
graphicColor: "0xffffff",
graphicWidth: 300,
graphicHeight: 300,
graphicRadius: 40
}, {
type: "text",
content: "The white behind me\nis a [Phaser.Graphic]",
fontFamily: "Luckiest Guy",
fontSize: 22,
color: "0x1e1e1e",
offsetY: -50
}, ]
});
},
showModal1: function(){
reg.modal.showModal("modal1");
}
有什么可以帮忙的吗...
【问题讨论】:
标签: javascript jquery phaser-framework