Tidying up the wip folder and updating pixi.
@@ -0,0 +1,109 @@
|
||||
<?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', 'states', 'book');
|
||||
$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 .= "<a href=\"wip/filters/index.php?f=$file\">$value2</a><br />";
|
||||
}
|
||||
|
||||
return $output;
|
||||
|
||||
}
|
||||
?>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>phaser</title>
|
||||
<base href="../../"></base>
|
||||
<?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 {
|
||||
font-family: Arial;
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="phaser-example"></div>
|
||||
|
||||
<h2>work in progress filters</h2>
|
||||
|
||||
<?php
|
||||
echo printJSLinks('wip', $files);
|
||||
?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 67 KiB |
|
Before Width: | Height: | Size: 179 KiB After Width: | Height: | Size: 179 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 86 KiB |
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 86 KiB |
|
Before Width: | Height: | Size: 151 KiB After Width: | Height: | Size: 151 KiB |
|
Before Width: | Height: | Size: 200 KiB After Width: | Height: | Size: 200 KiB |
|
Before Width: | Height: | Size: 110 KiB After Width: | Height: | Size: 110 KiB |
|
Before Width: | Height: | Size: 146 KiB After Width: | Height: | Size: 146 KiB |
|
Before Width: | Height: | Size: 171 KiB After Width: | Height: | Size: 171 KiB |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 66 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 241 B After Width: | Height: | Size: 241 B |
|
Before Width: | Height: | Size: 258 KiB After Width: | Height: | Size: 258 KiB |
@@ -32,7 +32,7 @@
|
||||
|
||||
function dirToArray($dir) {
|
||||
|
||||
$ignore = array('.', '..', '_site', 'assets', 'states', 'book');
|
||||
$ignore = array('.', '..', '_site', 'assets', 'states', 'book', 'filters');
|
||||
$result = array();
|
||||
$root = scandir($dir);
|
||||
$dirs = array_diff($root, $ignore);
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
|
||||
var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create, update: update });
|
||||
|
||||
var logo;
|
||||
var background;
|
||||
var filter;
|
||||
|
||||
function preload() {
|
||||
|
||||
game.load.image('phaser', 'assets/sprites/phaser2.png');
|
||||
game.load.script('fire', '../filters/Fire.js');
|
||||
|
||||
}
|
||||
|
||||
function create() {
|
||||
|
||||
|
||||
background = game.add.sprite(0, 0);
|
||||
background.width = 800;
|
||||
background.height = 600;
|
||||
|
||||
filter = game.add.filter('Fire', 800, 600);
|
||||
filter.alpha = 0.0;
|
||||
|
||||
background.filters = [filter];
|
||||
|
||||
logo = game.add.sprite(game.world.centerX, game.world.centerY, 'phaser');
|
||||
logo.anchor.setTo(0.5, 0.5);
|
||||
|
||||
game.input.onDown.add(removeBackground, this);
|
||||
|
||||
}
|
||||
|
||||
function update() {
|
||||
|
||||
filter.update();
|
||||
|
||||
}
|
||||
|
||||
function removeBackground() {
|
||||
|
||||
console.log('removeBackground');
|
||||
|
||||
// background.destroy();
|
||||
background.removeFilter(filter);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
|
||||
var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create, update: update, render: render });
|
||||
|
||||
function preload() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
var sprite;
|
||||
|
||||
function create() {
|
||||
|
||||
}
|
||||
|
||||
function update() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
function render() {
|
||||
|
||||
}
|
||||