forked from phaserjs/phaser-ce-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfull.php
More file actions
142 lines (125 loc) · 4.47 KB
/
Copy pathfull.php
File metadata and controls
142 lines (125 loc) · 4.47 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<?php
require('config.php');
$png = '';
$filename = '';
$current = false;
$title = 'Index';
if (isset($_GET['s']) && $_GET['s'] !== '')
{
$current = $_GET['s'];
$title = ucfirst($current);
}
if (isset($_GET['f']) && $_GET['f'] !== '')
{
$filename = $_GET['f'];
$png = str_replace('.js', '.png', $filename);
$png = str_replace('/', '_', $png);
$title = $filename;
}
$path = realpath(dirname(__FILE__));
$modules = array(
'debug' => true,
'keyboard' => true,
'gamepad' => true,
'bitmapdata' => true,
'graphics' => true,
'rendertexture' => true,
'text' => true,
'bitmaptext' => true,
'retrofont' => true,
'tweens' => true,
'sound' => true,
'particles' => true,
'tilemap' => true,
'arcade' => true,
'p2' => true,
'ninja' => false,
'box2d' => false,
'joystick' => false,
'creature' => true,
'video' => true,
'rope' => true,
'tilesprite' => true
);
foreach ($modules as $module => $modset)
{
if (isset($_COOKIE[$module]))
{
if ($_COOKIE[$module] === 'true')
{
$modules[$module] = true;
}
else if ($_COOKIE[$module] === 'false')
{
$modules[$module] = false;
}
}
}
$dist = 'php';
if (isset($_COOKIE['dist']) && $_COOKIE['dist'] === 'js')
{
$dist = 'js';
}
$target = 'div';
if (isset($_COOKIE['target']) && $_COOKIE['target'] === 'iframe')
{
$target = 'iframe';
}
?>
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Phaser Examples - <?php echo $title ?></title>
<?php
if ($target == 'div')
{
if ($dist === 'php' && in_array($_SERVER['SERVER_NAME'], $config_hosts))
{
$path = $config_phaser_path;
require($path . '/build/config.php');
}
else
{
echo '<script src="_site/phaser/' . $config_phaser_min . '" type="text/javascript"></script>';
}
if ($modules['box2d'])
{
// This is only enabled if you have the Phaser Box2D Plugin Source files
echo "<script src=\"/phaser-box2d/src/box2d/box2d-html5.js\" type=\"text/javascript\"></script>";
echo "<script src=\"/phaser-box2d/src/plugin/World.js\" type=\"text/javascript\"></script>";
echo "<script src=\"/phaser-box2d/src/plugin/Body.js\" type=\"text/javascript\"></script>";
echo "<script src=\"/phaser-box2d/src/plugin/PointProxy.js\" type=\"text/javascript\"></script>";
echo "<script src=\"/phaser-box2d/src/plugin/DefaultDebugDraw.js\" type=\"text/javascript\"></script>";
echo "<script src=\"/phaser-box2d/src/plugin/DefaultContactListener.js\" type=\"text/javascript\"></script>";
echo "<script src=\"/phaser-box2d/src/plugin/Polygon.js\" type=\"text/javascript\"></script>";
}
if ($modules['joystick'])
{
// This is only enabled if you have the Phaser Virtual Joystick Plugin Source files
echo "<script src=\"/arcadestorm/VirtualJoysticks/plugin/src/Pad.js\" type=\"text/javascript\"></script>";
echo "<script src=\"/arcadestorm/VirtualJoysticks/plugin/src/Stick.js\" type=\"text/javascript\"></script>";
echo "<script src=\"/arcadestorm/VirtualJoysticks/plugin/src/DPad.js\" type=\"text/javascript\"></script>";
echo "<script src=\"/arcadestorm/VirtualJoysticks/plugin/src/Button.js\" type=\"text/javascript\"></script>";
}
}
?>
</head>
<style type="text/css">
html, body {
margin: 0
}
</style>
<body>
<div id="phaser-example"></div>
<script type="text/javascript" charset="utf-8">
<?php
if ($filename !== '' && $target === 'div')
{
$src = file_get_contents($filename);
echo $src;
}
?>
</script>
</body>
</html>