{"size": 882, "ext": "js", "max_stars_repo_path": "public/package/phaser3-examples-master/public/src/display/masks/spotlight.js", "max_stars_repo_name": "iamjack996/Vue-SPA", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "public/package/phaser3-examples-master/public/src/display/masks/spotlight.js", "max_issues_repo_name": "iamjack996/Vue-SPA", "max_issues_repo_issues_event_min_datetime": "2021-03-10T06:27:00.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-18T19:37:39.000Z", "max_forks_repo_path": "public/package/phaser3-examples-master/public/src/display/masks/spotlight.js", "max_forks_repo_name": "iamjack996/Vue-SPA", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 3, "max_forks_count": null, "avg_line_length": 19.6, "max_line_length": 68, "alphanum_fraction": 0.5782312925}
var config = {
    type: Phaser.WEBGL,
    parent: 'phaser-example',
    width: 800,
    height: 600,
    scene: {
        preload: preload,
        create: create
    }
};

var game = new Phaser.Game(config);

function preload ()
{
    this.load.image('pic', 'assets/pics/taikodrummaster.jpg');
    this.load.image('mask', 'assets/sprites/mask1.png');
    this.load.image('logo', 'assets/sprites/phaser.png');
}

function create ()
{
    this.add.image(100, 60, 'logo');

    var pic = this.add.image(400, 300, 'pic');

    this.add.image(100, 260, 'logo');

    var spotlight = this.make.sprite({
        x: 400,
        y: 300,
        key: 'mask',
        add: false
    });

    pic.mask = new Phaser.Display.Masks.BitmapMask(this, spotlight);

    this.input.on('pointermove', function (pointer) {

        spotlight.x = pointer.x;
        spotlight.y = pointer.y;

    });
}
