2014-02-14 12:07:04 +00:00
|
|
|
|
2014-02-14 16:38:06 +00:00
|
|
|
var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create, update: update });
|
2014-02-14 12:07:04 +00:00
|
|
|
|
|
|
|
function preload() {
|
|
|
|
|
2014-03-03 17:03:15 +00:00
|
|
|
game.load.image('knightHawks', 'assets/fonts/retroFonts/KNIGHT3.png');
|
2014-02-14 12:07:04 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
var font;
|
|
|
|
|
|
|
|
function create() {
|
|
|
|
|
2014-03-03 22:43:35 +00:00
|
|
|
font = game.add.retroFont('knightHawks', 31, 25, Phaser.RetroFont.TEXT_SET6, 10, 1, 1);
|
2014-02-14 13:50:50 +00:00
|
|
|
font.text = 'phaser was here';
|
2014-02-14 12:07:04 +00:00
|
|
|
|
2014-02-14 16:38:06 +00:00
|
|
|
for (var c = 0; c < 19; c++)
|
2014-02-14 13:50:50 +00:00
|
|
|
{
|
2014-02-14 16:38:06 +00:00
|
|
|
var i = game.add.image(game.world.centerX, c * 32, font);
|
2014-02-14 13:50:50 +00:00
|
|
|
i.tint = Math.random() * 0xFFFFFF;
|
2014-02-14 16:38:06 +00:00
|
|
|
i.anchor.set(0.5, 1);
|
2014-02-14 13:50:50 +00:00
|
|
|
}
|
|
|
|
|
2014-02-14 12:07:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function update() {
|
|
|
|
|
2014-02-14 16:38:06 +00:00
|
|
|
font.text = "phaser x: " + game.input.x + " y: " + game.input.y;
|
2014-02-14 12:07:04 +00:00
|
|
|
|
|
|
|
}
|