Jump to content

BitmapData.generateTexture Firefox


Recommended Posts

I've been playing around with BimapData, generating composite images on the fly because I'm too lazy to combine them in an image editor program :)

I noticed that the sprite drawn from the image cache key appeared in chrome, but not firefox.

I reproduced  this on the Phaser Sandbox - Single Sprite Template in chrome and firefox by setting the create code to the following:

function create() {
    var sprite = game.add.sprite(0, 0, 'phaser');

    var testBmd = game.make.bitmapData(27, 40);

    game.add.sprite(60, 60, 'phaserTexture')


The second phaser sprite appeared in chrome but not firefox.

Any input is appreciated, thanks!



Link to comment
Share on other sites

  • 2 months later...

Here is a workaround:

function preload() {
    var bmd = game.make.bitmapData(0, 0);
    // draw on bmd …
    this.load.image('bmdImage', bmd.canvas.toDataURL());

function create() {
    // If you need to make a spritesheet:
    this.cache.addSpriteSheet('bmdSpritesheet', null,
        frameWidth, frameHeight, frameMax, margin, spacing);

    this.add.sprite(0, 0, 'bmdImage');
    this.add.sprite(0, 0, 'bmdSpritesheet');


Link to comment
Share on other sites

  • 3 months later...

  • Recently Browsing   0 members

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