forked from phaserjs/phaser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloading multiple files.php
More file actions
60 lines (37 loc) · 1.31 KB
/
Copy pathloading multiple files.php
File metadata and controls
60 lines (37 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
$title = "Multi Touch";
require('../head.php');
?>
<script type="text/javascript">
function loadStarted(size) {
console.log('Loader started, queue size:', size);
}
// this.progress, previousKey, success, this.queueSize - this._keys.length, this.queueSize
function fileLoaded(progress, key, success, remaining, total) {
console.log('File Loaded:', key);
console.log('Progress: ' + progress + '%');
console.log('File: ' + remaining + ' out of ' + total);
}
function loadCompleted() {
console.log('Loader finished');
// Let's try adding an image to the DOM
document.body.appendChild(game.cache.getImage('cockpit'));
// And some text
var para = document.createElement('pre');
para.innerHTML = game.cache.getText('copyright');
document.body.appendChild(para);
}
var game = new Phaser.Game(320, 240, Phaser.AUTO, '', {preload:preload});
function preload () {
game.load.image('cockpit', 'assets/pics/cockpit.png');
game.load.image('rememberMe', 'assets/pics/remember-me.jpg');
game.load.image('overdose', 'assets/pics/lance-overdose-loader_eye.png');
game.load.text('copyright', 'assets/warning - copyright.txt');
game.load.onLoadStart.add(loadStarted, this);
game.load.onFileComplete.add(fileLoaded, this);
game.load.onLoadComplete.add(loadCompleted, this);
}
</script>
<?php
require('../foot.php');
?>