import Phaser from 'phaser'

export default class GoreOverlay extends Phaser.Group {
    constructor(game, parent, name) {
        super(game, parent, name);

        // const overlay = this.game.make.graphics(-250, -250);
        // overlay.beginFill(0x000000);
        // overlay.drawRect(0, 0, parent.width * 2, parent.height * 2);
        // overlay.endFill();
        // this.add(overlay);

        // const sprOverlay = this.game.add.sprite(overlay.x, overlay.y, overlay.generateTexture());
        // overlay.destroy();
        // sprOverlay.alpha = 0.5;
        // sprOverlay.blendMode = Phaser.blendModes.DARKEN
        // this.add(sprOverlay);
        

        const sprOverlay = this.game.add.sprite(-parent.x, -parent.y, 'goreOverlay');
        sprOverlay.width = parent.width * 1.1;
        sprOverlay.height = parent.height * 1.75;
        sprOverlay.alpha = 0.5;
        sprOverlay.blendMode = Phaser.blendModes.COLOR_BURN; //Phaser.blendModes.COLOR_BURN;
        this.add(sprOverlay);

        // this.directionY = 1;
        // this.directionX = 1;
    }
}
