mirror of
https://github.com/wassname/phaser.git
synced 2026-06-27 16:10:15 +08:00
8662cd2fd4
New build script now cleanly splits Phaser, Pixi and p2 so they are each UMD wrapped and each available in the global scope (now more requireJS friendly!). phaser-no-libs.js allows you to use your own version of p2.js or pixi.js with Phaser. Warning: This is totally unsupported. If you hit bugs, you fix them yourself. Fixed silly instanceof bug in game objects (sorry guys).
120 lines
3.0 KiB
PHP
120 lines
3.0 KiB
PHP
<?php
|
|
// Global
|
|
$files = dirToArray(dirname(__FILE__));
|
|
$total = 0;
|
|
|
|
foreach ($files as $key => $value)
|
|
{
|
|
if (is_array($value) && count($value) > 0)
|
|
{
|
|
$total += count($value);
|
|
}
|
|
}
|
|
|
|
function getFile() {
|
|
|
|
global $files, $dir, $filename, $title, $code;
|
|
|
|
if (isset($_GET['d']) && isset($_GET['f']))
|
|
{
|
|
$dir = urldecode($_GET['d']);
|
|
$filename = urldecode($_GET['d']) . '/' . urldecode($_GET['f']);
|
|
$title = urldecode($_GET['t']);
|
|
|
|
if (file_exists($filename))
|
|
{
|
|
$code = file_get_contents($filename);
|
|
$files = dirToArray($dir);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function dirToArray($dir) {
|
|
|
|
$ignore = array('.', '..', '_site', 'assets', 'gfx', 'states', 'book', 'filters', 'misc');
|
|
$result = array();
|
|
$root = scandir($dir);
|
|
$dirs = array_diff($root, $ignore);
|
|
|
|
foreach ($dirs as $key => $value)
|
|
{
|
|
if (is_dir($dir . DIRECTORY_SEPARATOR . $value))
|
|
{
|
|
$result[$value] = dirToArray($dir . DIRECTORY_SEPARATOR . $value);
|
|
}
|
|
else
|
|
{
|
|
if (substr($value, -3) == '.js')
|
|
{
|
|
$result[] = $value;
|
|
}
|
|
}
|
|
}
|
|
|
|
return $result;
|
|
}
|
|
|
|
function printJSLinks($dir, $files) {
|
|
|
|
$output = "";
|
|
|
|
foreach ($files as $key => $value)
|
|
{
|
|
$value2 = substr($value, 0, -3);
|
|
$file = urlencode($value);
|
|
|
|
$output .= "<tr><td><a href=\"wip/index.php?f=$file\">$value2</a></td>";
|
|
$output .= "<td><a href=\"wip/index-lib.php?f=$file\">[ single lib ]</a></td>";
|
|
$output .= "<td><a href=\"wip/index-fs.php?f=$file\">[ full screen ]</a></td>";
|
|
$output .= "<td><a href=\"wip/index-cocoon.php?f=$file\">[ cocoon ]</a></td></tr>";
|
|
}
|
|
|
|
return $output;
|
|
|
|
}
|
|
?>
|
|
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="initial-scale=1 maximum-scale=1 user-scalable=0 minimal-ui" />
|
|
<title>phaser</title>
|
|
<base href="../" />
|
|
<script src="_site/js/jquery-2.0.3.min.js" type="text/javascript"></script>
|
|
<?php
|
|
require('../../build/config.php');
|
|
|
|
if (isset($_GET['f']))
|
|
{
|
|
$f = $_GET['f'];
|
|
?>
|
|
<script src="wip/<?php echo $f?>" type="text/javascript"></script>
|
|
<?php
|
|
}
|
|
?>
|
|
<style>
|
|
body {
|
|
margin: 0;
|
|
padding: 0;
|
|
font-family: Arial;
|
|
font-size: 14px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<div id="phaser-example"></div>
|
|
|
|
<div style="padding: 32px">
|
|
|
|
<table cellpadding="8">
|
|
<?php
|
|
echo printJSLinks('wip', $files);
|
|
?>
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</body>
|
|
</html>
|