2014-02-21 14:50:18 +00:00
|
|
|
|
2014-02-21 15:09:04 +00:00
|
|
|
// var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create, update: update, render: render });
|
|
|
|
var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create, update: update, render: render });
|
2014-02-21 14:50:18 +00:00
|
|
|
|
|
|
|
function preload() {
|
|
|
|
|
|
|
|
game.load.image('pic', 'assets/pics/questar.png');
|
|
|
|
game.load.image('mask1', 'assets/pics/mask-test.png');
|
|
|
|
game.load.image('mask2', 'assets/pics/mask-test2.png');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
var pic;
|
|
|
|
|
|
|
|
function create() {
|
|
|
|
|
2014-02-21 15:09:04 +00:00
|
|
|
var bmd = game.make.bitmapData(320, 256);
|
|
|
|
|
|
|
|
bmd.alphaMask('pic', 'mask2');
|
|
|
|
|
|
|
|
pic = game.add.sprite(0, 0, bmd);
|
|
|
|
|
|
|
|
pic.scale.set(2);
|
2014-02-21 14:50:18 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function update() {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function render() {
|
|
|
|
|
|
|
|
}
|