admin管理员组文章数量:1426007
I want to use multiple new Phaser.Game
instances with Phaser.io but everything when I create a second Phaser.Game object I get the following error WebGL: INVALID_OPERATION: uniform2f: location not for current program
This is the HTML code I user
<div id="player1Holder"></div>
<div id="player2Holder"></div>
This is the JavaScript code I user
new Phaser.Game(700, 850, Phaser.AUTO, 'player1Holder');
new Phaser.Game(700, 850, Phaser.AUTO, 'player2Holder');
I want to use multiple new Phaser.Game
instances with Phaser.io but everything when I create a second Phaser.Game object I get the following error WebGL: INVALID_OPERATION: uniform2f: location not for current program
This is the HTML code I user
<div id="player1Holder"></div>
<div id="player2Holder"></div>
This is the JavaScript code I user
new Phaser.Game(700, 850, Phaser.AUTO, 'player1Holder');
new Phaser.Game(700, 850, Phaser.AUTO, 'player2Holder');
Share
Improve this question
asked Apr 17, 2014 at 0:28
Jürgen BrandstetterJürgen Brandstetter
7,3543 gold badges38 silver badges33 bronze badges
1 Answer
Reset to default 7You can't currently embed more than one Phaser game in a single page unless:
- The games use the Canvas Renderer only, OR
- Each game is in its own iframe.
This is because Phaser uses Pixi.js for rendering, and Pixi doesn't currently support multiple instances of its WebGL renderer.
本文标签: javascriptphaserio multiple phasergame instancesStack Overflow
版权声明:本文标题:javascript - phaser.io multiple phaser.game instances - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745448304a2658763.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论