reggie3 Posted March 9, 2015 Share Posted March 9, 2015 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 More sharing options...
Recommended Posts