我有一个简单的游戏创建与Angular 和bootstrap的phaserJs造型.我这里的问题是,当我显示 bootstrap 模式并在模式中单击时,它会影响到我的PhaserJS画布按钮.
更新:
预览代码示例:https://github-u3st63.stackblitz.io
示例代码:https://stackblitz.com/edit/github-u3st63
如何修复这个问题,因为我try 将z-index设置为Canvas,但它不起作用.
在进修期感谢
我有一个简单的游戏创建与Angular 和bootstrap的phaserJs造型.我这里的问题是,当我显示 bootstrap 模式并在模式中单击时,它会影响到我的PhaserJS画布按钮.
预览代码示例:https://github-u3st63.stackblitz.io
示例代码:https://stackblitz.com/edit/github-u3st63
如何修复这个问题,因为我try 将z-index设置为Canvas,但它不起作用.
在进修期感谢
这似乎是一个关于事件执行顺序的Angular 问题.因为我不是棱角方面的专家.我建议在打开模式对话框时简单地暂停游戏,使用函数pause
,类似于game.scene.pause('Game')
,而在关闭对话框时,您只需使用game.scene.resume('Game')
恢复游戏.Link to the documentation个
Here is an official phaser demo个向功能展示这些.
您只需连接组件之间的通信即可.
100 Just keep in mind if you have multiple scene running, that you would have to stop them all, and restart them again. In this case simply hiding the game might be a better option.