Jump to content

Resize Alpha Mask Before Application to Bitmapdata


reggie3
 Share

Recommended Posts

What is the proper technique for resizing an alpha mask before application?  I have already loaded the mask using load.image.  I've also created a bitmapdata that the mask is to applied to.  However, I have been unable to change the mask's size using the code below:

var bmd = this.state.game.add.bitmapData(this.detectionRange * 2, this.detectionRange * 2);var finalBmd = this.state.game.add.bitmapData(this.detectionRange * 2, this.detectionRange * 2);var sensorCircleRadius = this.detectionRange * GlobalVariables.pixelToKilometerRatio;var mask = new Phaser.Image(this.state.game, 0, 0, 'collisionCircle', 0);            mask.height = sensorCircleRadius * 2;mask.width = sensorCircleRadius * 2;finalBmd.alphaMask(bmd, mask);
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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