Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ParticleStorm v1.0.0 incompatibility in Phaser 2.7 #2863

Closed
capnlee opened this issue Nov 21, 2016 · 3 comments
Closed

ParticleStorm v1.0.0 incompatibility in Phaser 2.7 #2863

capnlee opened this issue Nov 21, 2016 · 3 comments

Comments

@capnlee
Copy link

capnlee commented Nov 21, 2016

This Issue is about A bug in the API

PIXI.canUseNewCanvasBlendModes no longer exists and is called directly by ParticleStorm

Seems to be the only incompatibility as by putting:
PIXI.canUseNewCanvasBlendModes = function () { return true; }
in the preload function it works fine.

@photonstorm
Copy link
Collaborator

Good catch. That property has moved to the Device class. You can get it from:

this.game.device.canUseMultiply

Which means if you do this in preload it should give you the correct result (rather than forcing it to be true all the time):

PIXI.canUseNewCanvasBlendModes = this.game.device.canUseMultiply

@hayesmaker
Copy link

that hotfix doesn't work for me...

this is my first state's preload method:

  preload: function () {
    PIXI.canUseNewCanvasBlendModes = this.game.device.canUseMultiply;
    game.load.image('splash', 'assets/images/splash-1.png');
  },

My scripts get loaded in the script tags in this order:

  script(src="javascripts/vendor/phaser.js")
  script(src="javascripts/vendor/phaser-virtual-joystick.js")
  script(src="javascripts/vendor/particle-storm-scrambled.js")
  script(src= engine)

phaser version: phaser-ce@2.7.3
where engine is my main game's js bundled.

error:

Uncaught TypeError: PIXI.canUseNewCanvasBlendModes is not a function
    at new Phaser.ParticleStorm (particle-storm-scrambled.js:1)
    at Phaser.PluginManager.add (phaser.js:29921)
    at Object.init (manager.js:39)
    at Object.create (boot.js:73)
    at Phaser.StateManager.loadComplete (phaser.js:28530)
    at Phaser.Loader.finishedLoading (phaser.js:75133)
    at Phaser.Loader.processLoadQueue (phaser.js:75090)
    at Phaser.Loader.asyncComplete (phaser.js:75162)
    at Phaser.Loader.fileComplete (phaser.js:76038)
    at HTMLImageElement.file.data.onload (phaser.js:75428)
Phaser.ParticleStorm @ particle-storm-scrambled.js:1
add @ phaser.js:29921
init @ manager.js:39
create @ boot.js:73
loadComplete @ phaser.js:28530
finishedLoading @ phaser.js:75133
processLoadQueue @ phaser.js:75090
asyncComplete @ phaser.js:75162
fileComplete @ phaser.js:76038
file.data.onload @ phaser.js:75428

@photonstorm
Copy link
Collaborator

PIXI.canUseNewCanvasBlendModes = function () { return this.game.device.canUseMultiply; }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants