Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var config = {
- type: Phaser.AUTO,
- width: 800,
- height: 600,
- parent: 'phaser-example',
- scene: {
- preload: preload,
- create: create
- }
- };
- var game = new Phaser.Game(config);
- function preload ()
- {
- this.load.image('pic', 'assets/pics/rick-and-morty-by-sawuinhaff-da64e7y.png');
- }
- function create ()
- {
- this.cameras.main.setBackgroundColor(0x63F6F7);
- var image = this.add.image(400, 300, 'pic');
- var shape = this.make.graphics();
- // Create a hash shape Graphics object
- shape.fillStyle(0xffffff);
- //shape.slice(400, 300, 200, Phaser.Math.DegToRad(360), 0, true);
- shape.fillCircleShape({x: 200, y: 200, radius: 100});
- shape.fillCircleShape({x: 500, y: 200, radius: 100});
- shape.fillPath();
- var mask = shape.createGeometryMask();
- image.setMask(mask);
- image.setMask(mask);
- image.mask.invertAlpha = true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement