Jump to content

Phaser group.cacheAsBitmap not working with mask


Valery
 Share

Recommended Posts

Hello,

I want to build a slot machine with Phaser and got a small problem.

My reel in slot is a group of textures which spins under mask. To improve performance on mobile devices want to set cacheAsBitmap property for a group to true but after that mask is not working :(

 var mask = this.game.add.graphics(0, 0);
 mask.beginFill(0x000000); 
 mask.alpha = 0; 
 mask.drawRect(this.reelsx, this.reelsy, this.cellwidth * 5, this.reelheight);

            
 var reelblurred = this.createReelBlurred(this.reelArray, this.reelheight);             
 reelblurred.mask = mask;


 createReelBlurred(arr, reelheight): Phaser.Group {
     var reelblurred = this.game.add.group();
     for (var i = 0; i < arr.length; i++) {             
          reelblurred.create(0, this.cellheight * i, 'symbols', this.reelArray + 'Blured');
     }           
     return reelblurred;
 }
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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