mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 13:13:43 +00:00
67ad898294
Added new Retro Font examples.
35 lines
881 B
JavaScript
35 lines
881 B
JavaScript
|
|
var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create, update: update });
|
|
|
|
function preload() {
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
var text;
|
|
var text2;
|
|
|
|
function create() {
|
|
|
|
text = game.add.bitmapText(100, 100, 'carrier', 'Phaser and Pixi\nrocking!', 32);
|
|
|
|
text2 = game.add.bitmapText(100, 300, 'desyrel', 'Phaser & Pixi\nrocking!', 64);
|
|
|
|
game.input.onDown.add(change, this);
|
|
|
|
}
|
|
|
|
function change() {
|
|
|
|
text.align = 'center';
|
|
text2.tint = Math.random() * 0xFFFFFF;
|
|
|
|
}
|
|
|
|
function update() {
|
|
|
|
// text.text = 'Phaser & Pixi\nrocking!\n' + Math.round(game.time.now);
|
|
|
|
}
|