Skip to content

Commit e2eddc8

Browse files
committed
Added Full Screen support and tested it. Also added in the BitmapText game object and custom XML loader. Game now sends a pause and resume signal, which the TweenManager listens to and handles correctly.
1 parent e41e35f commit e2eddc8

15 files changed

Lines changed: 2470 additions & 104 deletions

File tree

274 KB
Loading

examples/assets/fonts/desyrel-pink.xml

Lines changed: 1922 additions & 0 deletions
Large diffs are not rendered by default.

examples/bitmapFont1.php

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<!DOCTYPE HTML>
2+
<html>
3+
<head>
4+
<title>phaser.js - a new beginning</title>
5+
<?php
6+
require('js.php');
7+
?>
8+
</head>
9+
<body>
10+
11+
<script type="text/javascript">
12+
13+
(function () {
14+
15+
var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update, render: render });
16+
17+
function preload() {
18+
19+
game.load.bitmapFont('desyrel', 'assets/fonts/desyrel.png', 'assets/fonts/desyrel.xml');
20+
21+
}
22+
23+
function create() {
24+
25+
game.add.bitmapText(200, 100, 'Phaser\nis rocking!', { font: '64px Desyrel', align: 'center' });
26+
27+
}
28+
29+
function update() {
30+
}
31+
32+
function render() {
33+
}
34+
35+
})();
36+
</script>
37+
38+
</body>
39+
</html>

examples/fullscreen.php

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<!DOCTYPE HTML>
2+
<html>
3+
<head>
4+
<title>phaser.js - a new beginning</title>
5+
<?php
6+
require('js.php');
7+
?>
8+
<style type="text/css">
9+
body {
10+
margin: 0;
11+
}
12+
</style>
13+
</head>
14+
<body>
15+
16+
<script type="text/javascript">
17+
18+
(function () {
19+
20+
var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update, render: render });
21+
22+
function preload() {
23+
24+
game.load.image('atari1', 'assets/sprites/atari130xe.png');
25+
26+
}
27+
28+
function create() {
29+
30+
var tempSprite = game.add.sprite(0, 0, 'atari1');
31+
32+
game.stage.backgroundColor = '#e3ed49';
33+
34+
game.input.onDown.add(gofull, this);
35+
36+
}
37+
38+
function gofull() {
39+
game.stage.scale.startFullScreen();
40+
}
41+
42+
function update() {
43+
}
44+
45+
function render() {
46+
}
47+
48+
})();
49+
</script>
50+
51+
</body>
52+
</html>

examples/js.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
<script src="../src/gameobjects/Button.js"></script>
6767
<script src="../src/gameobjects/Graphics.js"></script>
6868
<script src="../src/gameobjects/RenderTexture.js"></script>
69+
<script src="../src/gameobjects/BitmapText.js"></script>
6970
<script src="../src/system/Canvas.js"></script>
7071
<script src="../src/system/StageScaleMode.js"></script>
7172
<script src="../src/system/Device.js"></script>
@@ -88,6 +89,7 @@
8889
<script src="../src/animation/Parser.js"></script>
8990
<script src="../src/loader/Cache.js"></script>
9091
<script src="../src/loader/Loader.js"></script>
92+
<script src="../src/loader/Parser.js"></script>
9193
<script src="../src/sound/Sound.js"></script>
9294
<script src="../src/sound/SoundManager.js"></script>
9395
<script src="../src/utils/Debug.js"></script>

0 commit comments

Comments
 (0)