compressionAlgorithm error

#1

When I return to the same game state my phaser throw this error (im current using Phaser CE v2.12.0):

Uncaught TypeError: Cannot read property 'compressionAlgorithm' of null
    at s.WebGLRenderer.updateTexture (phaser.min.js:3)
    at s.WebGLSpriteBatch.renderBatch (phaser.min.js:3)
    at s.WebGLSpriteBatch.flush (phaser.min.js:3)
    at s.WebGLSpriteBatch.render (phaser.min.js:3)
    at e.Sprite.s.Sprite._renderWebGL (phaser.min.js:3)
    at e.Group.s.DisplayObjectContainer._renderWebGL (phaser.min.js:3)
    at e.World.s.DisplayObjectContainer._renderWebGL (phaser.min.js:3)
    at e.Stage.s.DisplayObjectContainer._renderWebGL (phaser.min.js:3)
    at s.WebGLRenderer.renderDisplayObject (phaser.min.js:3)
    at s.WebGLRenderer.render (phaser.min.js:3)

There’s a video displaying the error in the game:
https://www.youtube.com/watch?v=iQK9ZmXsU70

0 Likes

#2

How are you changing states?

0 Likes

#3
this.game.state.start("battle", null, null, {
    data: this.Data,
    socket: this.Socket,

    auth: this.auth,
    player: this.player.data,

    flag: this.flag,

    // parâmetros

    param: data.param
});

and the instance do add game state is:

this.gameInstance.state.add("overworld", Game.Overworld);
this.gameInstance.state.add("battle", Game.Battle);
0 Likes

#4

at e.Sprite.s.Sprite._renderWebGL (phaser.min.js:3)

Can you see which sprite/texture this is? Set breakpoint, or break on exception.

0 Likes

#5

I’ll upgrade to Phaser 3, I expect to not encounter this error on phaser 3. Thx.

0 Likes