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');
You can't currently embed more than one Phaser game in a single page unless:
This is because Phaser uses Pixi.js for rendering, and Pixi doesn't currently support multiple instances of its WebGL renderer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With