Skip to content

Commit 04160c3

Browse files
committed
Moved docgen into the Resources folder.
1 parent f8a1632 commit 04160c3

259 files changed

Lines changed: 21245 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

resources/docgen/export.php

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<?php
2+
if (isset($_GET['src']))
3+
{
4+
$src = $_GET['src'];
5+
}
6+
7+
require 'src/Block.php';
8+
require 'src/ClassDesc.php';
9+
require 'src/Constant.php';
10+
require 'src/Method.php';
11+
require 'src/Parameter.php';
12+
require 'src/Property.php';
13+
require 'src/ReturnType.php';
14+
require 'src/Processor.php';
15+
require 'src/PhaserDocGen.php';
16+
?>
17+
<!doctype html>
18+
<html>
19+
<head>
20+
<meta charset="UTF-8" />
21+
<title>Phaser Documentation Generator</title>
22+
<style type="text/css">
23+
body {
24+
font-family: Arial;
25+
font-size: 14px;
26+
background-color: #fff;
27+
color: #000;
28+
}
29+
30+
textarea {
31+
width: 100%;
32+
height: 1000px;
33+
}
34+
</style>
35+
</head>
36+
<body>
37+
38+
<pre>
39+
<?php
40+
41+
$gen = new PhaserDocGen();
42+
43+
echo "Starting ...\n";
44+
45+
$gen->start();
46+
47+
echo "Extending ...\n";
48+
49+
$gen->extend();
50+
51+
echo "Exporting ...\n";
52+
53+
$gen->export('output/');
54+
55+
// $obj = $gen->get('Phaser.Animation');
56+
// print_r($obj->getArray());
57+
// echo $obj;
58+
59+
// ksort($gen->uniqueTypes);
60+
// echo "There are " . count($gen->uniqueTypes) . " unique data types \n\n";
61+
// print_r($gen->uniqueTypes);
62+
63+
// $gen->extend('Phaser.Sprite');
64+
// $sprite = $gen->get('Phaser.Sprite');
65+
// $sprite->export('output/');
66+
67+
// echo $sprite;
68+
69+
70+
71+
72+
?>
73+
</pre>
74+
75+
</body>
76+
</html>

resources/docgen/index.php

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8" />
5+
<title>Phaser Documentation Viewer</title>
6+
<style type="text/css">
7+
body {
8+
font-family: Arial;
9+
font-size: 14px;
10+
background-color: #fff;
11+
color: #000;
12+
}
13+
14+
textarea {
15+
width: 100%;
16+
height: 1000px;
17+
}
18+
</style>
19+
</head>
20+
<body>
21+
22+
<a href="export.php">Export</a>
23+
24+
<?php
25+
// http://uk1.php.net/manual/en/class.splfileinfo.php
26+
27+
function dirToArray($dir) {
28+
29+
global $src;
30+
31+
$ignore = array('.', '..');
32+
$fileIgnore = array('p2.js');
33+
$result = array();
34+
$root = scandir($dir);
35+
$dirs = array_diff($root, $ignore);
36+
37+
foreach ($dirs as $key => $value)
38+
{
39+
$path = realpath($dir . DIRECTORY_SEPARATOR . $value);
40+
41+
if (is_dir($path))
42+
{
43+
$result[$value] = dirToArray($path);
44+
}
45+
else
46+
{
47+
if (substr($value, -3) == '.js')
48+
{
49+
if (!in_array($value, $fileIgnore))
50+
{
51+
$index = str_replace($src, "", $path);
52+
$index = substr($index, 1);
53+
54+
$result[substr($value, 0, -3)] = $index;
55+
}
56+
}
57+
}
58+
}
59+
60+
return $result;
61+
}
62+
63+
function displaySection($title, $files) {
64+
65+
if ($title === "")
66+
{
67+
echo "<h1>Phaser v2.1.1</h1>";
68+
}
69+
else
70+
{
71+
echo "<h2>$title</h2>";
72+
}
73+
74+
echo "<ul>";
75+
76+
foreach ($files as $name => $file)
77+
{
78+
if (is_array($file))
79+
{
80+
displaySection($name, $file);
81+
}
82+
else
83+
{
84+
echo "<li><a href=\"view.php?src=$file\">$name</a>";
85+
// echo " &nbsp;&nbsp; [ <a href=\"export.php?src=$file\">json</a> ]</li>";
86+
echo " &nbsp;&nbsp; [ <a href=\"json.php?src=$file\">json</a> ]</li>";
87+
}
88+
}
89+
90+
echo "</ul>";
91+
92+
}
93+
94+
$src = realpath('../src');
95+
96+
$files = dirToArray($src);
97+
98+
displaySection("", $files);
99+
100+
// echo "<pre>";
101+
// var_dump($src);
102+
// print_r($files);
103+
// echo "</pre>";
104+
105+
?>
106+
107+
</body>
108+
</html>

resources/docgen/json.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
if (isset($_GET['src']))
3+
{
4+
$src = $_GET['src'];
5+
}
6+
7+
require 'src/Block.php';
8+
require 'src/ClassDesc.php';
9+
require 'src/Constant.php';
10+
require 'src/Method.php';
11+
require 'src/Parameter.php';
12+
require 'src/Property.php';
13+
require 'src/ReturnType.php';
14+
require 'src/Processor.php';
15+
require 'src/PhaserDocGen.php';
16+
17+
header('Content-Type: application/json');
18+
19+
$gen = new PhaserDocGen();
20+
$gen->start();
21+
22+
$obj = $gen->get($src);
23+
$obj->extend();
24+
25+
echo $obj->getJSON();
26+
?>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"class":{"name":"PIXI.AbstractFilter","extends":"","static":false,"constructor":true,"parameters":[{"name":"fragmentSrc","type":["array"],"help":"The fragment source in an array of strings.","optional":false,"default":null},{"name":"uniforms","type":["object"],"help":"An object containing the uniforms for this filter.","optional":false,"default":null}],"help":"This is the base class for creating a PIXI filter. Currently only webGL supports filters.\\nIf you want to make a custom filter this should be your base class."},"consts":[],"methods":{"public":[{"name":"syncUniforms","static":false,"returns":null,"help":"Syncs the uniforms between the class object and the shaders.","line":65,"public":true,"protected":false,"private":false,"parameters":[],"inherited":true,"inheritedFrom":"PIXI.AbstractFilter"}],"protected":[],"private":[],"static":[]},"properties":{"public":[{"name":"dirty","type":["boolean"],"help":"","inlineHelp":"","line":35,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"padding","type":["number"],"help":"","inlineHelp":"","line":41,"default":null,"public":true,"protected":false,"private":false,"readOnly":false}],"protected":[],"private":[{"name":"fragmentSrc","type":["array"],"help":"","inlineHelp":"","line":55,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"passes","type":["array"],"help":"An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion.\\nFor example the blur filter has two passes blurX and blurY.","inlineHelp":"","line":22,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"shaders","type":["array"],"help":"","inlineHelp":"","line":29,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"uniforms","type":["object"],"help":"","inlineHelp":"","line":48,"default":null,"public":false,"protected":false,"private":true,"readOnly":false}]}}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"class":{"name":"PIXI.AjaxRequest","extends":"","static":false,"constructor":true,"parameters":[],"help":"A wrapper for ajax requests to be handled cross browser"},"consts":[],"methods":{"public":[{"name":"bind","static":false,"returns":null,"help":"A polyfill for Function.prototype.bind","line":79,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"canUseNewCanvasBlendModes","static":false,"returns":{"types":["boolean"],"help":"whether they are supported"},"help":"Checks whether the Canvas BlendModes are supported by the current browser","line":174,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"cancelAnimationFrame","static":false,"returns":null,"help":"A polyfill for cancelAnimationFrame","line":25,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"getNextPowerOfTwo","static":false,"returns":{"types":["number"],"help":"the closest number that is a power of two"},"help":"Given a number, this function returns the closest number that is a power of two\\nthis function is taken from Starling Framework as its pretty neat ;)","line":197,"public":true,"protected":false,"private":false,"parameters":[{"name":"number","type":["number"],"help":"","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"hex2rgb","static":false,"returns":null,"help":"Converts a hex color number to an [R, G, B] array","line":60,"public":true,"protected":false,"private":false,"parameters":[{"name":"hex","type":["number"],"help":"","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"requestAnimationFrame","static":false,"returns":null,"help":"A polyfill for requestAnimationFrame\\nYou can actually use both requestAnimationFrame and requestAnimFrame,\\nyou will still benefit from the polyfill","line":19,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"rgb2hex","static":false,"returns":null,"help":"Converts a color as an [R, G, B] array to a hex number","line":70,"public":true,"protected":false,"private":false,"parameters":[{"name":"rgb","type":["array"],"help":"","optional":false,"default":null}],"inherited":false,"inheritedFrom":""}],"protected":[],"private":[],"static":[]},"properties":{"public":[],"protected":[],"private":[]}}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"class":{"name":"PIXI.AlphaMaskFilter","extends":"PIXI.AbstractFilter","static":false,"constructor":true,"parameters":[{"name":"texture","type":["PIXI.Texture"],"help":"The texture used for the displacement map * must be power of 2 texture at the moment","optional":false,"default":null}],"help":"The AlphaMaskFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object.\\nYou can use this filter to apply all manor of crazy warping effects\\nCurrently the r property of the texture is used to offset the x and the g property of the texture is used to offset the y."},"consts":[],"methods":{"public":[{"name":"onTextureLoaded","static":false,"returns":null,"help":"Sets the map dimensions uniforms when the texture becomes available.","line":76,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"syncUniforms","static":false,"returns":null,"help":"Syncs the uniforms between the class object and the shaders.","line":65,"public":true,"protected":false,"private":false,"parameters":[],"inherited":true,"inheritedFrom":"PIXI.AbstractFilter"}],"protected":[],"private":[],"static":[]},"properties":{"public":[{"name":"dirty","type":["boolean"],"help":"","inlineHelp":"","line":35,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"map","type":["PIXI.Texture"],"help":"The texture used for the displacement map. Must be power of 2 sized texture.","inlineHelp":"","line":90,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"padding","type":["number"],"help":"","inlineHelp":"","line":41,"default":null,"public":true,"protected":false,"private":false,"readOnly":false}],"protected":[],"private":[]}}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"class":{"name":"PIXI.AsciiFilter","extends":"PIXI.AbstractFilter","static":false,"constructor":true,"parameters":[],"help":"An ASCII filter."},"consts":[],"methods":{"public":[{"name":"syncUniforms","static":false,"returns":null,"help":"Syncs the uniforms between the class object and the shaders.","line":65,"public":true,"protected":false,"private":false,"parameters":[],"inherited":true,"inheritedFrom":"PIXI.AbstractFilter"}],"protected":[],"private":[],"static":[]},"properties":{"public":[{"name":"dirty","type":["boolean"],"help":"","inlineHelp":"","line":35,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"padding","type":["number"],"help":"","inlineHelp":"","line":41,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"size","type":["number"],"help":"The pixel size used by the filter.","inlineHelp":"","line":79,"default":null,"public":true,"protected":false,"private":false,"readOnly":false}],"protected":[],"private":[]}}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"class":{"name":"PIXI.AssetLoader","extends":"","static":false,"constructor":true,"parameters":[{"name":"assetURLs","type":["array string"],"help":"An array of image\/sprite sheet urls that you would like loaded","optional":false,"default":null},{"name":"crossorigin","type":["boolean"],"help":"Whether requests should be treated as crossorigin","optional":false,"default":null}],"help":"A Class that loads a bunch of images \/ sprite sheet \/ bitmap font files. Once the\\nassets have been loaded they are added to the PIXI Texture cache and can be accessed\\neasily through PIXI.Texture.fromImage() and PIXI.Sprite.fromImage()\\nWhen all items have been loaded this class will dispatch a 'onLoaded' event\\nAs each individual item is loaded this class will dispatch a 'onProgress' event\\n\\nsupported. Supported image formats include 'jpeg', 'jpg', 'png', 'gif'. Supported\\nsprite sheet data formats only include 'JSON' at this time. Supported bitmap font\\ndata formats include 'xml' and 'fnt'."},"consts":[],"methods":{"public":[{"name":"_getDataType","static":false,"returns":null,"help":"Given a filename, returns its extension.","line":80,"public":true,"protected":false,"private":false,"parameters":[{"name":"str","type":["string"],"help":"the name of the asset","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"load","static":false,"returns":null,"help":"Starts loading the assets sequentially","line":112,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""}],"protected":[],"private":[{"name":"onAssetLoaded","static":false,"returns":null,"help":"Invoked after each file is loaded","line":149,"public":false,"protected":false,"private":true,"parameters":[],"inherited":false,"inheritedFrom":""}],"static":[]},"properties":{"public":[{"name":"assetURLs","type":["array string"],"help":"The array of asset URLs that are going to be loaded","inlineHelp":"","line":29,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"crossorigin","type":["boolean"],"help":"Whether the requests should be treated as cross origin","inlineHelp":"","line":37,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"loadersByType","type":["object"],"help":"Maps file extension to loader types","inlineHelp":"","line":45,"default":null,"public":true,"protected":false,"private":false,"readOnly":false}],"protected":[],"private":[]}}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"class":{"name":"PIXI.AtlasLoader","extends":"","static":false,"constructor":true,"parameters":[{"name":"url","type":["string"],"help":"The url of the JSON file","optional":false,"default":null},{"name":"crossorigin","type":["boolean"],"help":"Whether requests should be treated as crossorigin","optional":false,"default":null}],"help":"The atlas file loader is used to load in Texture Atlas data and parse it. When loaded this class will dispatch a 'loaded' event. If loading fails this class will dispatch an 'error' event.\\n\\nTo generate the data you can use http:\/\/www.codeandweb.com\/texturepacker and publish in the 'JSON' format.\\n\\nIt is highly recommended to use texture atlases (also know as 'sprite sheets') as it allowed sprites to be batched and drawn together for highly increased rendering speed.\\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFrameId()"},"consts":[],"methods":{"public":[{"name":"load","static":false,"returns":null,"help":"Starts loading the JSON file","line":37,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""}],"protected":[],"private":[{"name":"onAtlasLoaded","static":false,"returns":null,"help":"Invoked when the Atlas has fully loaded. Parses the JSON and builds the texture frames.","line":52,"public":false,"protected":false,"private":true,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"onError","static":false,"returns":null,"help":"Invoked when an error occurs.","line":188,"public":false,"protected":false,"private":true,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"onLoaded","static":false,"returns":null,"help":"Invoked when json file has loaded.","line":172,"public":false,"protected":false,"private":true,"parameters":[],"inherited":false,"inheritedFrom":""}],"static":[]},"properties":{"public":[],"protected":[],"private":[]}}

0 commit comments

Comments
 (0)