mirror of
https://github.com/wassname/phaser.git
synced 2026-09-09 11:28:47 +08:00
Brand new Grunt task - creates each core library as its own file and a combined phaser.js.
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).
This commit is contained in:
@@ -1,133 +0,0 @@
|
||||
<?php
|
||||
// Global
|
||||
// $files = dirToArray(dirname(__FILE__));
|
||||
$files = dirToArray('../');
|
||||
$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', 'states', 'wip', 'games', 'basics');
|
||||
$result = array();
|
||||
$root = scandir($dir);
|
||||
$dirs = array_diff($root, $ignore);
|
||||
|
||||
// We want these 2 to appear top of the list
|
||||
array_unshift($dirs, 'basics', 'games');
|
||||
|
||||
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, $target) {
|
||||
|
||||
$output = "";
|
||||
|
||||
foreach ($files as $key => $value)
|
||||
{
|
||||
$value2 = substr($value, 0, -3);
|
||||
$dir = urlencode($dir);
|
||||
$file = urlencode($value);
|
||||
$title = urlencode($value2);
|
||||
|
||||
if ($target == 'viewer')
|
||||
{
|
||||
$output .= " <a href=\"view_lite.php?d=$dir&f=$file&t=$title\" target=\"viewer\">$value2</a></br>\n";
|
||||
}
|
||||
else if ($target == 'json')
|
||||
{
|
||||
$output .= " { \"file\": \"$file\", \"title\": \"$value2\" },\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$output .= " <li><a href=\"view_full.php?d=$dir&f=$file&t=$title\">$value2</a></li>\n";
|
||||
}
|
||||
}
|
||||
|
||||
if ($target == 'json')
|
||||
{
|
||||
$output = rtrim($output);
|
||||
$output = substr($output, 0, -1);
|
||||
$output .= "\n";
|
||||
}
|
||||
|
||||
return $output;
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
|
||||
<head>
|
||||
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
|
||||
<title>Phaser Examples JSON Build Script</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<textarea style="width: 800px; height: 800px">
|
||||
<?php
|
||||
$output = "{\n";
|
||||
|
||||
foreach ($files as $key => $value)
|
||||
{
|
||||
if (is_array($value) && count($value) > 0)
|
||||
{
|
||||
$output .= "\"$key\": [\n";
|
||||
|
||||
$output .= printJSLinks($key, $value, 'json');
|
||||
|
||||
$output .= "],\n";
|
||||
}
|
||||
}
|
||||
|
||||
$output = rtrim($output);
|
||||
$output = substr($output, 0, -1);
|
||||
$output .= "\n}";
|
||||
|
||||
echo $output;
|
||||
|
||||
file_put_contents('examples.json', $output);
|
||||
?>
|
||||
</textarea>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -58,7 +58,7 @@ $(document).ready(function(){
|
||||
|
||||
.done(function(data) {
|
||||
|
||||
if (data.version !== '1.1.4')
|
||||
if (data.version !== '2.0.0')
|
||||
{
|
||||
$("#upgrade").append(data.version);
|
||||
$("#upgrade").css('display', 'inline-block');
|
||||
|
||||
@@ -10,21 +10,16 @@
|
||||
<!--
|
||||
If you're wondering why we embed each script separately, and not just the single-file phaser lib
|
||||
it's because it makes debugging *significantly* easier for us. Feel free to replace all the below
|
||||
with just a call to ../dist/phaser.js instead if you prefer.
|
||||
with just a call to ../build/phaser.js instead if you prefer.
|
||||
-->
|
||||
<script src="../build/p2.js"></script>
|
||||
<script src="../src/Intro.js"></script>
|
||||
<script src="../src/p2.js"></script>
|
||||
|
||||
<script src="../src/pixi/Pixi.js"></script>
|
||||
<script src="../src/Phaser.js"></script>
|
||||
<script src="../src/utils/Utils.js"></script>
|
||||
|
||||
<script src="../src/geom/Circle.js"></script>
|
||||
<script src="../src/geom/Point.js"></script>
|
||||
<script src="../src/geom/Rectangle.js"></script>
|
||||
<script src="../src/geom/Line.js"></script>
|
||||
<script src="../src/geom/Ellipse.js"></script>
|
||||
<script src="../src/geom/Polygon.js"></script>
|
||||
|
||||
<script src="../src/pixi/core/Point.js"></script>
|
||||
<script src="../src/pixi/core/Rectangle.js"></script>
|
||||
<script src="../src/pixi/core/Polygon.js"></script>
|
||||
<script src="../src/pixi/core/Circle.js"></script>
|
||||
<script src="../src/pixi/core/Ellipse.js"></script>
|
||||
<script src="../src/pixi/core/Matrix.js"></script>
|
||||
<script src="../src/pixi/display/DisplayObject.js"></script>
|
||||
<script src="../src/pixi/display/DisplayObjectContainer.js"></script>
|
||||
@@ -34,6 +29,7 @@
|
||||
<script src="../src/pixi/text/Text.js"></script>
|
||||
<script src="../src/pixi/text/BitmapText.js"></script>
|
||||
<script src="../src/pixi/display/Stage.js"></script>
|
||||
<script src="../src/pixi/utils/Utils.js"></script>
|
||||
<script src="../src/pixi/utils/EventTarget.js"></script>
|
||||
<script src="../src/pixi/utils/Polyk.js"></script>
|
||||
<script src="../src/pixi/renderers/webgl/utils/WebGLShaderUtils.js"></script>
|
||||
@@ -59,6 +55,16 @@
|
||||
<script src="../src/pixi/textures/Texture.js"></script>
|
||||
<script src="../src/pixi/textures/RenderTexture.js"></script>
|
||||
|
||||
<script src="../src/Phaser.js"></script>
|
||||
<script src="../src/utils/Utils.js"></script>
|
||||
|
||||
<script src="../src/geom/Circle.js"></script>
|
||||
<script src="../src/geom/Point.js"></script>
|
||||
<script src="../src/geom/Rectangle.js"></script>
|
||||
<script src="../src/geom/Line.js"></script>
|
||||
<script src="../src/geom/Ellipse.js"></script>
|
||||
<script src="../src/geom/Polygon.js"></script>
|
||||
|
||||
<script src="../src/core/Camera.js"></script>
|
||||
<script src="../src/core/State.js"></script>
|
||||
<script src="../src/core/StateManager.js"></script>
|
||||
@@ -71,8 +77,8 @@
|
||||
<script src="../src/core/Stage.js"></script>
|
||||
<script src="../src/core/Group.js"></script>
|
||||
<script src="../src/core/World.js"></script>
|
||||
<script src="../src/core/ScaleManager.js"></script>
|
||||
<script src="../src/core/Game.js"></script>
|
||||
<script src="../src/core/ScaleManager.js"></script>
|
||||
|
||||
<script src="../src/input/Input.js"></script>
|
||||
<script src="../src/input/Key.js"></script>
|
||||
@@ -163,7 +169,7 @@
|
||||
<div class="header">
|
||||
<div class="box100 no-padding">
|
||||
<div class="phaser-version">
|
||||
<span>Phaser Version: 1.2</span>
|
||||
<span>Phaser Version: 2.0.0</span>
|
||||
<a id="upgrade" href="https://github.com/photonstorm/phaser" class="version-button">New version: </a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -12,19 +12,14 @@
|
||||
it's because it makes debugging *significantly* easier for us. Feel free to replace all the below
|
||||
with just a call to ../build/phaser.js instead if you prefer.
|
||||
-->
|
||||
<script src="../build/p2.js"></script>
|
||||
<script src="../src/Intro.js"></script>
|
||||
<script src="../src/p2.js"></script>
|
||||
|
||||
<script src="../src/pixi/Pixi.js"></script>
|
||||
<script src="../src/Phaser.js"></script>
|
||||
<script src="../src/utils/Utils.js"></script>
|
||||
|
||||
<script src="../src/geom/Circle.js"></script>
|
||||
<script src="../src/geom/Point.js"></script>
|
||||
<script src="../src/geom/Rectangle.js"></script>
|
||||
<script src="../src/geom/Line.js"></script>
|
||||
<script src="../src/geom/Ellipse.js"></script>
|
||||
<script src="../src/geom/Polygon.js"></script>
|
||||
|
||||
<script src="../src/pixi/core/Point.js"></script>
|
||||
<script src="../src/pixi/core/Rectangle.js"></script>
|
||||
<script src="../src/pixi/core/Polygon.js"></script>
|
||||
<script src="../src/pixi/core/Circle.js"></script>
|
||||
<script src="../src/pixi/core/Ellipse.js"></script>
|
||||
<script src="../src/pixi/core/Matrix.js"></script>
|
||||
<script src="../src/pixi/display/DisplayObject.js"></script>
|
||||
<script src="../src/pixi/display/DisplayObjectContainer.js"></script>
|
||||
@@ -34,6 +29,7 @@
|
||||
<script src="../src/pixi/text/Text.js"></script>
|
||||
<script src="../src/pixi/text/BitmapText.js"></script>
|
||||
<script src="../src/pixi/display/Stage.js"></script>
|
||||
<script src="../src/pixi/utils/Utils.js"></script>
|
||||
<script src="../src/pixi/utils/EventTarget.js"></script>
|
||||
<script src="../src/pixi/utils/Polyk.js"></script>
|
||||
<script src="../src/pixi/renderers/webgl/utils/WebGLShaderUtils.js"></script>
|
||||
@@ -59,6 +55,16 @@
|
||||
<script src="../src/pixi/textures/Texture.js"></script>
|
||||
<script src="../src/pixi/textures/RenderTexture.js"></script>
|
||||
|
||||
<script src="../src/Phaser.js"></script>
|
||||
<script src="../src/utils/Utils.js"></script>
|
||||
|
||||
<script src="../src/geom/Circle.js"></script>
|
||||
<script src="../src/geom/Point.js"></script>
|
||||
<script src="../src/geom/Rectangle.js"></script>
|
||||
<script src="../src/geom/Line.js"></script>
|
||||
<script src="../src/geom/Ellipse.js"></script>
|
||||
<script src="../src/geom/Polygon.js"></script>
|
||||
|
||||
<script src="../src/core/Camera.js"></script>
|
||||
<script src="../src/core/State.js"></script>
|
||||
<script src="../src/core/StateManager.js"></script>
|
||||
@@ -71,8 +77,8 @@
|
||||
<script src="../src/core/Stage.js"></script>
|
||||
<script src="../src/core/Group.js"></script>
|
||||
<script src="../src/core/World.js"></script>
|
||||
<script src="../src/core/ScaleManager.js"></script>
|
||||
<script src="../src/core/Game.js"></script>
|
||||
<script src="../src/core/ScaleManager.js"></script>
|
||||
|
||||
<script src="../src/input/Input.js"></script>
|
||||
<script src="../src/input/Key.js"></script>
|
||||
|
||||
Reference in New Issue
Block a user