Goshawk Posted July 21, 2018 Share Posted July 21, 2018 After many hours of head scratching I've discovered that I cannot get particles to work in canvas. However, if I switch to game type AUTO, the particle emitter works. Is there any way to get particles to work in canvas mode or is it not supported? import 'phaser'; window.onload = function(){ var config = { type: Phaser.CANVAS, // Particles won't render unless setting is Phaser.AUTO parent: 'phaser-example', width: 800, height: 600, scene: PlayGame }; var game = new Phaser.Game(config); } class PlayGame extends Phaser.Scene{ constructor(){ super('PlayGame'); } preload(){ this.load.image('block', 'assets/block.png'); } create(){ this.block = this.add.particles('block'); this.block.createEmitter({ angle: { min: 240, max: 300 }, speed: { min: 200, max: 300 }, quantity: 6, lifespan: 2000, alpha: { start: 1, end: 0 }, scale: { start: 1.5, end: 0.5 }, on: false }); this.input.on('pointerdown', function (pointer) { this.block.emitParticleAt(pointer.x, pointer.y); }, this); } } Link to comment Share on other sites More sharing options...
kurhlaa Posted July 22, 2018 Share Posted July 22, 2018 My particles work with canvas to me. Not sure whether this will help, but could you try to add blendMode: 'SCREEN' to your createEmitter({ ? Link to comment Share on other sites More sharing options...
Tom Atom Posted July 25, 2018 Share Posted July 25, 2018 Problem is connected with this bug: https://github.com/photonstorm/phaser/issues/3862 If I run, for example, this example: http://labs.phaser.io/view.html?src=src/game objects/particle emitter/angled emitter.js in Canvas, it hits problematic line in ParticleManagerCanvasRenderer.js (https://github.com/photonstorm/phaser/blob/master/src/gameobjects/particles/ParticleManagerCanvasRenderer.js#L106) Link to comment Share on other sites More sharing options...
Recommended Posts