1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 | // ex06. Text
var game = new Phaser.Game(800, 600, Phaser.AUTO, 'ex06',
{create: create});
function create() {
// Set backgound color
game.stage.backgroundColor = "#0FFF0F";
// Style for text
var style = {
font: 'bold 50pt Tarzan',
fill: '#D0171B',
align: 'center'
}
// center coordinates
var x = game.world.centerX;
var y = game.world.centerY;
// Show text with x,y the center point
text = game.add.text(x, y, 'Hello\nPhaser\nWorld', style);
text.anchor.setTo(0.5);
}
|
No comments:
Post a Comment