2014-02-14 03:34:35 +00:00
|
|
|
|
|
|
|
var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create, update: update });
|
|
|
|
|
|
|
|
function preload() {
|
|
|
|
|
2014-03-03 22:43:35 +00:00
|
|
|
game.load.bitmapFont('desyrel', 'assets/fonts/bitmapFonts/desyrel.png', 'assets/fonts/bitmapFonts/desyrel.xml', null, 0, -32);
|
|
|
|
game.load.bitmapFont('carrier', 'assets/fonts/bitmapFonts/carrier_command.png', 'assets/fonts/bitmapFonts/carrier_command.xml', null, 0, 24);
|
2014-02-14 03:34:35 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
var text;
|
|
|
|
var text2;
|
|
|
|
|
|
|
|
function create() {
|
|
|
|
|
2014-02-14 04:34:57 +00:00
|
|
|
text = game.add.bitmapText(100, 100, 'carrier', 'Phaser and Pixi\nrocking!', 32);
|
|
|
|
|
|
|
|
text2 = game.add.bitmapText(100, 300, 'desyrel', 'Phaser & Pixi\nrocking!', 64);
|
2014-02-14 03:34:35 +00:00
|
|
|
|
|
|
|
game.input.onDown.add(change, this);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function change() {
|
|
|
|
|
2014-02-14 04:34:57 +00:00
|
|
|
text.align = 'center';
|
|
|
|
text2.tint = Math.random() * 0xFFFFFF;
|
2014-02-14 03:34:35 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function update() {
|
|
|
|
|
|
|
|
// text.text = 'Phaser & Pixi\nrocking!\n' + Math.round(game.time.now);
|
|
|
|
|
|
|
|
}
|