forked from phaserjs/phaser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrendertexture.php
More file actions
42 lines (28 loc) · 779 Bytes
/
Copy pathrendertexture.php
File metadata and controls
42 lines (28 loc) · 779 Bytes
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
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.CANVAS, '', { preload: preload, create: create, render: render });
function preload() {
game.load.image('atari1', 'assets/sprites/atari130xe.png');
}
function create() {
var tempSprite = game.add.sprite(0, 0, 'atari1');
tempSprite.visible = false;
var renderTexture = game.add.renderTexture('fuji', 320, 200);
renderTexture.render(tempSprite);
var texturedSprite = game.add.sprite(400, 300, renderTexture);
}
function render() {
}
})();
</script>
</body>
</html>