Jump to content

chrome showing blending but no firefox


Chefo
 Share

Recommended Posts

Hello,

I'm using Phaser CE trying to make a very simple game were two cowboys shoot them but in the middle there is a Cactus which gets destroyed with every shot.

I followed this example https://phaser.io/tutorials/coding-tips-002 run nice  in every browser.

So I have almost everything working in chrome but in Firefox I cant see anything drawn over the BMP.

It's hard to simplify my original code. So I tried to build a very simple one to showcase my problem by extracting code from the example link. I just want to draw a whole when pressing key A.

I also tried with different blending modes. It still does run ok in chrome but not in FF nor safari.

Has it anything to do with my code or with the browsers...?

var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update });
var background;
var landBMP;

function preload() {
    game.load.image('land','assets/images/land.png');
    game.load.image('background','assets/images/background.png');
}

function create() {

    boomKey =  game.input.keyboard.addKey(Phaser.Keyboard.A);
    boomKey.onDown.add(drawBoom, this);
    // Load Background
    background = this.add.sprite(0, 0, 'background');
    // Load bmp data
    landBMP = this.add.bitmapData(992, 480);
    landBMP.draw('land');
    landBMP.update();
    landBMP.addToWorld();

}

function drawBoom(){
    landBMP.blendDestinationOut();
    landBMP.circle(300, 400, 60, 'rgba(0, 0, 0, 255');
    landBMP.blendReset();
    landBMP.update();
}
function update() {
}

Any help is apreciated

PS: I attached my results with chrome and firefox after pressing A key

result with chrome.png

result with firefox.png

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...