mirror of
https://github.com/wassname/phaser.git
synced 2026-10-28 13:11:50 +08:00
Input Component done and new Button object done and included. Also finished the build script.
This commit is contained in:
1 parent
50624c1552
commit
9b6c819e0e
16 files changed
+26055
-29119
No files matched your search
@@ -0,0 +1,37 @@
|
||||
<textarea style="width: 800px; height: 800px">
|
||||
<?php
|
||||
|
||||
$js = file('../examples/js.php');
|
||||
$output = "";
|
||||
|
||||
for ($i = 0; $i < count($js); $i++)
|
||||
{
|
||||
// <script src="../src/Phaser.js"></script>
|
||||
$line = trim($js[$i]);
|
||||
|
||||
if (strpos($line, '<script') !== false)
|
||||
{
|
||||
$line = str_replace('<script src="', '', $line);
|
||||
$line = str_replace('"></script>', '', $line);
|
||||
|
||||
echo $line . "\n";
|
||||
|
||||
// Read the file in
|
||||
$source = file_get_contents($line);
|
||||
|
||||
if ($i == 4)
|
||||
{
|
||||
// Built at: {buildDate}
|
||||
$source = str_replace('{buildDate}', date('r'), $source);
|
||||
}
|
||||
|
||||
$output .= $source . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
//echo $output;
|
||||
|
||||
file_put_contents('phaser.js', $output);
|
||||
|
||||
?>
|
||||
</textarea>
|
||||
-14596
File diff suppressed because it is too large.
Load diff
Vendored
+1
@@ -0,0 +1 @@
|
||||
var PIXI=PIXI||{};var Phaser=Phaser||{VERSION:"1.0.0",GAMES:[],AUTO:0,CANVAS:1,WEBGL:2};PIXI.InteractionManager=function(c){};Phaser.Utils={isPlainObject:function(d){if(typeof(d)!=="object"||d.nodeType||d===d.window){return false}try{if(d.constructor&&!hasOwn.call(d.constructor.prototype,"isPrototypeOf")){return false}}catch(c){return false}return true},extend:function(){var n,e,c,d,k,l,j=arguments[0]||{},h=1,f=arguments.length,m=false;if(typeof j==="boolean"){m=j;j=arguments[1]||{};h=2}if(f===h){j=this;--h}for(;h<f;h++){if((n=arguments[h])!=null){for(e in n){c=j[e];d=n[e];if(j===d){continue}if(m&&d&&(Phaser.Utils.isPlainObject(d)||(k=Array.isArray(d)))){if(k){k=false;l=c&&Array.isArray(c)?c:[]}else{l=c&&Phaser.Utils.isPlainObject(c)?c:{}}j[e]=extend(m,l,d)}else{if(d!==undefined){j[e]=d}}}}}return j}};function HEXtoRGB(c){return[(c>>16&255)/255,(c>>8&255)/255,(c&255)/255]}if(typeof Function.prototype.bind!="function"){Function.prototype.bind=(function(){var c=Array.prototype.slice;return function(d){var h=this,i=c.call(arguments,1);if(typeof h!="function"){throw new TypeError()}function e(){var j=i.concat(c.call(arguments));h.apply(this instanceof e?this:d,j)}e.prototype=(function f(j){j&&(f.prototype=j);if(!(this instanceof f)){return new f}})(h.prototype);return e}})()}function determineMatrixArrayType(){PIXI.Matrix=(typeof Float32Array!=="undefined")?Float32Array:Array;return PIXI.Matrix}determineMatrixArrayType();PIXI.mat3={};PIXI.mat3.create=function(){var c=new PIXI.Matrix(9);c[0]=1;c[1]=0;c[2]=0;c[3]=0;c[4]=1;c[5]=0;c[6]=0;c[7]=0;c[8]=1;return c};PIXI.mat3.identity=function(c){c[0]=1;c[1]=0;c[2]=0;c[3]=0;c[4]=1;c[5]=0;c[6]=0;c[7]=0;c[8]=1;return c};PIXI.mat4={};PIXI.mat4.create=function(){var c=new PIXI.Matrix(16);c[0]=1;c[1]=0;c[2]=0;c[3]=0;c[4]=0;c[5]=1;c[6]=0;c[7]=0;c[8]=0;c[9]=0;c[10]=1;c[11]=0;c[12]=0;c[13]=0;c[14]=0;c[15]=1;return c};PIXI.mat3.multiply=function(t,j,k){if(!k){k=t}var A=t[0],z=t[1],w=t[2],i=t[3],h=t[4],f=t[5],q=t[6],p=t[7],o=t[8],n=j[0],m=j[1],l=j[2],v=j[3],u=j[4],s=j[5],e=j[6],d=j[7],c=j[8];k[0]=n*A+m*i+l*q;k[1]=n*z+m*h+l*p;k[2]=n*w+m*f+l*o;k[3]=v*A+u*i+s*q;k[4]=v*z+u*h+s*p;k[5]=v*w+u*f+s*o;k[6]=e*A+d*i+c*q;k[7]=e*z+d*h+c*p;k[8]=e*w+d*f+c*o;return k};PIXI.mat3.clone=function(d){var c=new PIXI.Matrix(9);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];c[4]=d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];return c};PIXI.mat3.transpose=function(e,d){if(!d||e===d){var h=e[1],f=e[2],c=e[5];e[1]=e[3];e[2]=e[6];e[3]=h;e[5]=e[7];e[6]=f;e[7]=c;return e}d[0]=e[0];d[1]=e[3];d[2]=e[6];d[3]=e[1];d[4]=e[4];d[5]=e[7];d[6]=e[2];d[7]=e[5];d[8]=e[8];return d};PIXI.mat3.toMat4=function(d,c){if(!c){c=PIXI.mat4.create()}c[15]=1;c[14]=0;c[13]=0;c[12]=0;c[11]=0;c[10]=d[8];c[9]=d[7];c[8]=d[6];c[7]=0;c[6]=d[5];c[5]=d[4];c[4]=d[3];c[3]=0;c[2]=d[2];c[1]=d[1];c[0]=d[0];return c};PIXI.mat4.create=function(){var c=new PIXI.Matrix(16);c[0]=1;c[1]=0;c[2]=0;c[3]=0;c[4]=0;c[5]=1;c[6]=0;c[7]=0;c[8]=0;c[9]=0;c[10]=1;c[11]=0;c[12]=0;c[13]=0;c[14]=0;c[15]=1;return c};PIXI.mat4.transpose=function(f,e){if(!e||f===e){var k=f[1],i=f[2],h=f[3],c=f[6],j=f[7],d=f[11];f[1]=f[4];f[2]=f[8];f[3]=f[12];f[4]=k;f[6]=f[9];f[7]=f[13];f[8]=i;f[9]=c;f[11]=f[14];f[12]=h;f[13]=j;f[14]=d;return f}e[0]=f[0];e[1]=f[4];e[2]=f[8];e[3]=f[12];e[4]=f[1];e[5]=f[5];e[6]=f[9];e[7]=f[13];e[8]=f[2];e[9]=f[6];e[10]=f[10];e[11]=f[14];e[12]=f[3];e[13]=f[7];e[14]=f[11];e[15]=f[15];return e};PIXI.mat4.multiply=function(s,k,m){if(!m){m=s}var A=s[0],z=s[1],v=s[2],t=s[3];var j=s[4],h=s[5],e=s[6],c=s[7];var q=s[8],p=s[9],o=s[10],n=s[11];var C=s[12],B=s[13],w=s[14],u=s[15];var l=k[0],i=k[1],f=k[2],d=k[3];m[0]=l*A+i*j+f*q+d*C;m[1]=l*z+i*h+f*p+d*B;m[2]=l*v+i*e+f*o+d*w;m[3]=l*t+i*c+f*n+d*u;l=k[4];i=k[5];f=k[6];d=k[7];m[4]=l*A+i*j+f*q+d*C;m[5]=l*z+i*h+f*p+d*B;m[6]=l*v+i*e+f*o+d*w;m[7]=l*t+i*c+f*n+d*u;l=k[8];i=k[9];f=k[10];d=k[11];m[8]=l*A+i*j+f*q+d*C;m[9]=l*z+i*h+f*p+d*B;m[10]=l*v+i*e+f*o+d*w;m[11]=l*t+i*c+f*n+d*u;l=k[12];i=k[13];f=k[14];d=k[15];m[12]=l*A+i*j+f*q+d*C;m[13]=l*z+i*h+f*p+d*B;m[14]=l*v+i*e+f*o+d*w;m[15]=l*t+i*c+f*n+d*u;return m};PIXI.Point=function(c,d){this.x=c||0;this.y=d||0};PIXI.Point.prototype.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.prototype.constructor=PIXI.Point;PIXI.Rectangle=function(d,f,e,c){this.x=d||0;this.y=f||0;this.width=e||0;this.height=c||0};PIXI.Rectangle.prototype.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.prototype.contains=function(c,f){if(this.width<=0||this.height<=0){return false}var d=this.x;if(c>=d&&c<=d+this.width){var e=this.y;if(f>=e&&f<=e+this.height){return true}}return false};PIXI.Rectangle.prototype.constructor=PIXI.Rectangle;PIXI.DisplayObject=function(){this.last=this;this.first=this;this.position=new PIXI.Point();this.scale=new PIXI.Point(1,1);this.pivot=new PIXI.Point(0,0);this.rotation=0;this.alpha=1;this.visible=true;this.hitArea=null;this.buttonMode=false;this.renderable=false;this.parent=null;this.stage=null;this.worldAlpha=1;this._interactiLine truncated
|
||||
-14470
File diff suppressed because it is too large.
Load diff
+25389
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,36 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>phaser.js - a new beginning</title>
|
||||
<?php
|
||||
require('js.php');
|
||||
?>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
(function () {
|
||||
|
||||
var game = new Phaser.Game(800, 600, Phaser.CANVAS, '', { preload: preload, create: create, render: render });
|
||||
|
||||
function preload() {
|
||||
|
||||
game.load.image('atari1', 'assets/sprites/atari130xe.png');
|
||||
|
||||
}
|
||||
|
||||
function create() {
|
||||
|
||||
// var tempSprite = game.add.sprite(game.world.randomX, game.world.randomY, game.rnd.pick(images));
|
||||
|
||||
}
|
||||
|
||||
function render() {
|
||||
}
|
||||
|
||||
})();
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,55 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>phaser.js - a new beginning</title>
|
||||
<?php
|
||||
require('js.php');
|
||||
?>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
(function () {
|
||||
|
||||
var game = new Phaser.Game(800, 600, Phaser.CANVAS, '', { preload: preload, create: create, render: render });
|
||||
|
||||
function preload() {
|
||||
|
||||
game.load.image('atari1', 'assets/sprites/atari130xe.png');
|
||||
game.load.image('atari2', 'assets/sprites/atari800xl.png');
|
||||
game.load.image('atari4', 'assets/sprites/atari800.png');
|
||||
game.load.image('sonic', 'assets/sprites/sonic_havok_sanity.png');
|
||||
game.load.image('duck', 'assets/sprites/darkwing_crazy.png');
|
||||
game.load.image('firstaid', 'assets/sprites/firstaid.png');
|
||||
game.load.image('diamond', 'assets/sprites/diamond.png');
|
||||
game.load.image('mushroom', 'assets/sprites/mushroom2.png');
|
||||
|
||||
}
|
||||
|
||||
function create() {
|
||||
|
||||
// This returns an array of all the image keys in the cache
|
||||
var images = game.cache.getImageKeys();
|
||||
|
||||
var test = game.add.group();
|
||||
|
||||
// Now let's create some random sprites and enable them all for drag and 'bring to top'
|
||||
for (var i = 0; i < 20; i++)
|
||||
{
|
||||
var tempSprite = test.create(game.world.randomX, game.world.randomY, game.rnd.pick(images));
|
||||
tempSprite.inputEnabled = true;
|
||||
tempSprite.input.enableDrag(false, true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function render() {
|
||||
game.debug.renderInputInfo(32, 32);
|
||||
}
|
||||
|
||||
})();
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,65 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>phaser.js - a new beginning</title>
|
||||
<?php
|
||||
require('js.php');
|
||||
?>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
(function () {
|
||||
|
||||
var game = new Phaser.Game(800, 600, Phaser.CANVAS, '', { preload: preload, create: create, render: render });
|
||||
|
||||
function preload() {
|
||||
|
||||
game.load.image('beast', 'assets/pics/shadow_of_the_beast2_karamoon.png');
|
||||
game.load.spritesheet('button', 'assets/buttons/button_sprite_sheet.png', 193, 71);
|
||||
|
||||
}
|
||||
|
||||
var image;
|
||||
var button;
|
||||
|
||||
function create() {
|
||||
|
||||
// This is just an image that we'll toggle the display of when you click the button
|
||||
image = game.add.sprite(game.world.centerX, 0, 'beast');
|
||||
image.anchor.setTo(0.5, 0);
|
||||
|
||||
// This button is created from a sprite sheet.
|
||||
// Frame 0 = the 'down' state
|
||||
// Frame 1 = the 'out' state
|
||||
// Frame 2 = the 'over' state
|
||||
// The function "clickedIt" will be called when the button is clicked or touched
|
||||
button = game.add.button(game.world.centerX, 400, 'button', clickedIt, this, 2, 1, 0);
|
||||
|
||||
// Just makes the button origin set to the middle, we only do this to center the button on-screen, no other reason
|
||||
button.anchor.setTo(0.5, 0.5);
|
||||
|
||||
}
|
||||
|
||||
function clickedIt() {
|
||||
|
||||
if (image.visible == true)
|
||||
{
|
||||
image.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
image.visible = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function render() {
|
||||
}
|
||||
|
||||
})();
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,116 @@
|
||||
<?php
|
||||
// All JS files in build order.
|
||||
// Much easier for debugging
|
||||
?>
|
||||
<script src="../src/pixi/Pixi.js"></script>
|
||||
|
||||
<script src="../src/Phaser.js"></script>
|
||||
<script src="../src/utils/Utils.js"></script>
|
||||
|
||||
<script src="../src/pixi/core/Matrix.js"></script>
|
||||
<script src="../src/pixi/core/Point.js"></script>
|
||||
<script src="../src/pixi/core/Rectangle.js"></script>
|
||||
<script src="../src/pixi/display/DisplayObject.js"></script>
|
||||
<script src="../src/pixi/display/DisplayObjectContainer.js"></script>
|
||||
<script src="../src/pixi/display/Sprite.js"></script>
|
||||
<script src="../src/pixi/display/MovieClip.js"></script>
|
||||
<script src="../src/pixi/display/Stage.js"></script>
|
||||
<script src="../src/pixi/extras/CustomRenderable.js"></script>
|
||||
<script src="../src/pixi/extras/Strip.js"></script>
|
||||
<script src="../src/pixi/extras/Rope.js"></script>
|
||||
<script src="../src/pixi/extras/Spine.js"></script>
|
||||
<script src="../src/pixi/extras/TilingSprite.js"></script>
|
||||
<script src="../src/pixi/filters/FilterBlock.js"></script>
|
||||
<script src="../src/pixi/filters/MaskFilter.js"></script>
|
||||
<script src="../src/pixi/primitives/Graphics.js"></script>
|
||||
<script src="../src/pixi/renderers/canvas/CanvasGraphics.js"></script>
|
||||
<script src="../src/pixi/renderers/canvas/CanvasRenderer.js"></script>
|
||||
<script src="../src/pixi/renderers/webgl/WebGLBatch.js"></script>
|
||||
<script src="../src/pixi/renderers/webgl/WebGLGraphics.js"></script>
|
||||
<script src="../src/pixi/renderers/webgl/WebGLRenderer.js"></script>
|
||||
<script src="../src/pixi/renderers/webgl/WebGLRenderGroup.js"></script>
|
||||
<script src="../src/pixi/renderers/webgl/WebGLShaders.js"></script>
|
||||
<script src="../src/pixi/text/BitmapText.js"></script>
|
||||
<script src="../src/pixi/text/Text.js"></script>
|
||||
<script src="../src/pixi/textures/BaseTexture.js"></script>
|
||||
<script src="../src/pixi/textures/Texture.js"></script>
|
||||
<script src="../src/pixi/textures/RenderTexture.js"></script>
|
||||
<script src="../src/pixi/utils/EventTarget.js"></script>
|
||||
<script src="../src/pixi/utils/Polyk.js"></script>
|
||||
|
||||
<script src="../src/core/Camera.js"></script>
|
||||
<script src="../src/core/State.js"></script>
|
||||
<script src="../src/core/StateManager.js"></script>
|
||||
<script src="../src/core/LinkedList.js"></script>
|
||||
<script src="../src/core/Signal.js"></script>
|
||||
<script src="../src/core/SignalBinding.js"></script>
|
||||
<script src="../src/core/Plugin.js"></script>
|
||||
<script src="../src/core/PluginManager.js"></script>
|
||||
<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/Game.js"></script>
|
||||
<script src="../src/input/Input.js"></script>
|
||||
<script src="../src/input/Keyboard.js"></script>
|
||||
<script src="../src/input/Mouse.js"></script>
|
||||
<script src="../src/input/MSPointer.js"></script>
|
||||
<script src="../src/input/Pointer.js"></script>
|
||||
<script src="../src/input/Touch.js"></script>
|
||||
<script src="../src/input/InputHandler.js"></script>
|
||||
<script src="../src/system/Canvas.js"></script>
|
||||
<script src="../src/gameobjects/Events.js"></script>
|
||||
<script src="../src/gameobjects/GameObjectFactory.js"></script>
|
||||
<script src="../src/gameobjects/Sprite.js"></script>
|
||||
<script src="../src/gameobjects/TileSprite.js"></script>
|
||||
<script src="../src/gameobjects/Text.js"></script>
|
||||
<script src="../src/system/Canvas.js"></script>
|
||||
<script src="../src/system/Device.js"></script>
|
||||
<script src="../src/system/RequestAnimationFrame.js"></script>
|
||||
<script src="../src/math/RandomDataGenerator.js"></script>
|
||||
<script src="../src/math/Math.js"></script>
|
||||
<script src="../src/math/QuadTree.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/net/Net.js"></script>
|
||||
<script src="../src/tween/TweenManager.js"></script>
|
||||
<script src="../src/tween/Tween.js"></script>
|
||||
<script src="../src/tween/Easing.js"></script>
|
||||
<script src="../src/time/Time.js"></script>
|
||||
<script src="../src/animation/AnimationManager.js"></script>
|
||||
<script src="../src/animation/Animation.js"></script>
|
||||
<script src="../src/animation/Frame.js"></script>
|
||||
<script src="../src/animation/FrameData.js"></script>
|
||||
<script src="../src/animation/Parser.js"></script>
|
||||
<script src="../src/loader/Cache.js"></script>
|
||||
<script src="../src/loader/Loader.js"></script>
|
||||
<script src="../src/sound/Sound.js"></script>
|
||||
<script src="../src/sound/SoundManager.js"></script>
|
||||
<script src="../src/utils/Debug.js"></script>
|
||||
|
||||
<script src="../src/physics/arcade/ArcadePhysics.js"></script>
|
||||
<script src="../src/physics/arcade/Body.js"></script>
|
||||
|
||||
<script src="../src/physics/advanced/Math.js"></script>
|
||||
<script src="../src/physics/advanced/Util.js"></script>
|
||||
<script src="../src/physics/advanced/Collision.js"></script>
|
||||
<script src="../src/physics/advanced/Body.js"></script>
|
||||
<script src="../src/physics/advanced/Joint.js"></script>
|
||||
<script src="../src/physics/advanced/Shape.js"></script>
|
||||
<script src="../src/physics/advanced/Contact.js"></script>
|
||||
<script src="../src/physics/advanced/ContactSolver.js"></script>
|
||||
<script src="../src/physics/advanced/Space.js"></script>
|
||||
<script src="../src/physics/advanced/joints/Angle.js"></script>
|
||||
<script src="../src/physics/advanced/joints/Revolute.js"></script>
|
||||
<script src="../src/physics/advanced/joints/Weld.js"></script>
|
||||
<script src="../src/physics/advanced/joints/Wheel.js"></script>
|
||||
<script src="../src/physics/advanced/joints/Prismatic.js"></script>
|
||||
<script src="../src/physics/advanced/joints/Distance.js"></script>
|
||||
<script src="../src/physics/advanced/joints/Rope.js"></script>
|
||||
<script src="../src/physics/advanced/joints/Mouse.js"></script>
|
||||
<script src="../src/physics/advanced/shapes/Circle.js"></script>
|
||||
<script src="../src/physics/advanced/shapes/Segment.js"></script>
|
||||
<script src="../src/physics/advanced/shapes/Poly.js"></script>
|
||||
<script src="../src/physics/advanced/shapes/Triangle.js"></script>
|
||||
<script src="../src/physics/advanced/shapes/Box.js"></script>
|
||||
|
||||
+3
-30
@@ -2,16 +2,13 @@
|
||||
// All JS files in build order.
|
||||
// Much easier for debugging
|
||||
?>
|
||||
<script src="../src/Intro.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/pixi/Pixi.js"></script>
|
||||
<script src="../src/pixi/InteractionManager.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/core/Point.js"></script>
|
||||
<script src="../src/pixi/core/Polygon.js"></script>
|
||||
<script src="../src/pixi/core/Rectangle.js"></script>
|
||||
<script src="../src/pixi/display/DisplayObject.js"></script>
|
||||
<script src="../src/pixi/display/DisplayObjectContainer.js"></script>
|
||||
@@ -40,7 +37,6 @@
|
||||
<script src="../src/pixi/textures/RenderTexture.js"></script>
|
||||
<script src="../src/pixi/utils/EventTarget.js"></script>
|
||||
<script src="../src/pixi/utils/Polyk.js"></script>
|
||||
<script src="../src/pixi/utils/Utils.js"></script>
|
||||
|
||||
<script src="../src/core/Camera.js"></script>
|
||||
<script src="../src/core/State.js"></script>
|
||||
@@ -67,6 +63,7 @@
|
||||
<script src="../src/gameobjects/Sprite.js"></script>
|
||||
<script src="../src/gameobjects/TileSprite.js"></script>
|
||||
<script src="../src/gameobjects/Text.js"></script>
|
||||
<script src="../src/gameobjects/Button.js"></script>
|
||||
<script src="../src/system/Canvas.js"></script>
|
||||
<script src="../src/system/Device.js"></script>
|
||||
<script src="../src/system/RequestAnimationFrame.js"></script>
|
||||
@@ -94,27 +91,3 @@
|
||||
|
||||
<script src="../src/physics/arcade/ArcadePhysics.js"></script>
|
||||
<script src="../src/physics/arcade/Body.js"></script>
|
||||
|
||||
<script src="../src/physics/advanced/Math.js"></script>
|
||||
<script src="../src/physics/advanced/Util.js"></script>
|
||||
<script src="../src/physics/advanced/Collision.js"></script>
|
||||
<script src="../src/physics/advanced/Body.js"></script>
|
||||
<script src="../src/physics/advanced/Joint.js"></script>
|
||||
<script src="../src/physics/advanced/Shape.js"></script>
|
||||
<script src="../src/physics/advanced/Contact.js"></script>
|
||||
<script src="../src/physics/advanced/ContactSolver.js"></script>
|
||||
<script src="../src/physics/advanced/Space.js"></script>
|
||||
<script src="../src/physics/advanced/joints/Angle.js"></script>
|
||||
<script src="../src/physics/advanced/joints/Revolute.js"></script>
|
||||
<script src="../src/physics/advanced/joints/Weld.js"></script>
|
||||
<script src="../src/physics/advanced/joints/Wheel.js"></script>
|
||||
<script src="../src/physics/advanced/joints/Prismatic.js"></script>
|
||||
<script src="../src/physics/advanced/joints/Distance.js"></script>
|
||||
<script src="../src/physics/advanced/joints/Rope.js"></script>
|
||||
<script src="../src/physics/advanced/joints/Mouse.js"></script>
|
||||
<script src="../src/physics/advanced/shapes/Circle.js"></script>
|
||||
<script src="../src/physics/advanced/shapes/Segment.js"></script>
|
||||
<script src="../src/physics/advanced/shapes/Poly.js"></script>
|
||||
<script src="../src/physics/advanced/shapes/Triangle.js"></script>
|
||||
<script src="../src/physics/advanced/shapes/Box.js"></script>
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
<?php
|
||||
// All JS files in build order.
|
||||
// Much easier for debugging
|
||||
?>
|
||||
<script src="../src/Phaser.js"></script>
|
||||
<script src="../src/utils/Utils.js"></script>
|
||||
|
||||
<script src="../src/pixi/Pixi.js"></script>
|
||||
<script src="../src/pixi/InteractionManager.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/core/Point.js"></script>
|
||||
<script src="../src/pixi/core/Polygon.js"></script>
|
||||
<script src="../src/pixi/core/Rectangle.js"></script>
|
||||
<script src="../src/pixi/display/DisplayObject.js"></script>
|
||||
<script src="../src/pixi/display/DisplayObjectContainer.js"></script>
|
||||
<script src="../src/pixi/display/Sprite.js"></script>
|
||||
<script src="../src/pixi/display/MovieClip.js"></script>
|
||||
<script src="../src/pixi/display/Stage.js"></script>
|
||||
<script src="../src/pixi/extras/CustomRenderable.js"></script>
|
||||
<script src="../src/pixi/extras/Strip.js"></script>
|
||||
<script src="../src/pixi/extras/Rope.js"></script>
|
||||
<script src="../src/pixi/extras/Spine.js"></script>
|
||||
<script src="../src/pixi/extras/TilingSprite.js"></script>
|
||||
<script src="../src/pixi/filters/FilterBlock.js"></script>
|
||||
<script src="../src/pixi/filters/MaskFilter.js"></script>
|
||||
<script src="../src/pixi/primitives/Graphics.js"></script>
|
||||
<script src="../src/pixi/renderers/canvas/CanvasGraphics.js"></script>
|
||||
<script src="../src/pixi/renderers/canvas/CanvasRenderer.js"></script>
|
||||
<script src="../src/pixi/renderers/webgl/WebGLBatch.js"></script>
|
||||
<script src="../src/pixi/renderers/webgl/WebGLGraphics.js"></script>
|
||||
<script src="../src/pixi/renderers/webgl/WebGLRenderer.js"></script>
|
||||
<script src="../src/pixi/renderers/webgl/WebGLRenderGroup.js"></script>
|
||||
<script src="../src/pixi/renderers/webgl/WebGLShaders.js"></script>
|
||||
<script src="../src/pixi/text/BitmapText.js"></script>
|
||||
<script src="../src/pixi/text/Text.js"></script>
|
||||
<script src="../src/pixi/textures/BaseTexture.js"></script>
|
||||
<script src="../src/pixi/textures/Texture.js"></script>
|
||||
<script src="../src/pixi/textures/RenderTexture.js"></script>
|
||||
<script src="../src/pixi/utils/EventTarget.js"></script>
|
||||
<script src="../src/pixi/utils/Polyk.js"></script>
|
||||
<script src="../src/pixi/utils/Utils.js"></script>
|
||||
|
||||
<script src="../src/core/Camera.js"></script>
|
||||
<script src="../src/core/State.js"></script>
|
||||
<script src="../src/core/StateManager.js"></script>
|
||||
<script src="../src/core/LinkedList.js"></script>
|
||||
<script src="../src/core/Signal.js"></script>
|
||||
<script src="../src/core/SignalBinding.js"></script>
|
||||
<script src="../src/core/Plugin.js"></script>
|
||||
<script src="../src/core/PluginManager.js"></script>
|
||||
<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/Game.js"></script>
|
||||
<script src="../src/input/Input.js"></script>
|
||||
<script src="../src/input/Keyboard.js"></script>
|
||||
<script src="../src/input/Mouse.js"></script>
|
||||
<script src="../src/input/MSPointer.js"></script>
|
||||
<script src="../src/input/Pointer.js"></script>
|
||||
<script src="../src/input/Touch.js"></script>
|
||||
<script src="../src/input/InputHandler.js"></script>
|
||||
<script src="../src/system/Canvas.js"></script>
|
||||
<script src="../src/gameobjects/Events.js"></script>
|
||||
<script src="../src/gameobjects/GameObjectFactory.js"></script>
|
||||
<script src="../src/gameobjects/Sprite.js"></script>
|
||||
<script src="../src/gameobjects/TileSprite.js"></script>
|
||||
<script src="../src/gameobjects/Text.js"></script>
|
||||
<script src="../src/system/Canvas.js"></script>
|
||||
<script src="../src/system/Device.js"></script>
|
||||
<script src="../src/system/RequestAnimationFrame.js"></script>
|
||||
<script src="../src/math/RandomDataGenerator.js"></script>
|
||||
<script src="../src/math/Math.js"></script>
|
||||
<script src="../src/math/QuadTree.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/net/Net.js"></script>
|
||||
<script src="../src/tween/TweenManager.js"></script>
|
||||
<script src="../src/tween/Tween.js"></script>
|
||||
<script src="../src/tween/Easing.js"></script>
|
||||
<script src="../src/time/Time.js"></script>
|
||||
<script src="../src/animation/AnimationManager.js"></script>
|
||||
<script src="../src/animation/Animation.js"></script>
|
||||
<script src="../src/animation/Frame.js"></script>
|
||||
<script src="../src/animation/FrameData.js"></script>
|
||||
<script src="../src/animation/Parser.js"></script>
|
||||
<script src="../src/loader/Cache.js"></script>
|
||||
<script src="../src/loader/Loader.js"></script>
|
||||
<script src="../src/sound/Sound.js"></script>
|
||||
<script src="../src/sound/SoundManager.js"></script>
|
||||
<script src="../src/utils/Debug.js"></script>
|
||||
|
||||
<script src="../src/physics/arcade/ArcadePhysics.js"></script>
|
||||
<script src="../src/physics/arcade/Body.js"></script>
|
||||
|
||||
<script src="../src/physics/advanced/Math.js"></script>
|
||||
<script src="../src/physics/advanced/Util.js"></script>
|
||||
<script src="../src/physics/advanced/Collision.js"></script>
|
||||
<script src="../src/physics/advanced/Body.js"></script>
|
||||
<script src="../src/physics/advanced/Joint.js"></script>
|
||||
<script src="../src/physics/advanced/Shape.js"></script>
|
||||
<script src="../src/physics/advanced/Contact.js"></script>
|
||||
<script src="../src/physics/advanced/ContactSolver.js"></script>
|
||||
<script src="../src/physics/advanced/Space.js"></script>
|
||||
<script src="../src/physics/advanced/joints/Angle.js"></script>
|
||||
<script src="../src/physics/advanced/joints/Revolute.js"></script>
|
||||
<script src="../src/physics/advanced/joints/Weld.js"></script>
|
||||
<script src="../src/physics/advanced/joints/Wheel.js"></script>
|
||||
<script src="../src/physics/advanced/joints/Prismatic.js"></script>
|
||||
<script src="../src/physics/advanced/joints/Distance.js"></script>
|
||||
<script src="../src/physics/advanced/joints/Rope.js"></script>
|
||||
<script src="../src/physics/advanced/joints/Mouse.js"></script>
|
||||
<script src="../src/physics/advanced/shapes/Circle.js"></script>
|
||||
<script src="../src/physics/advanced/shapes/Segment.js"></script>
|
||||
<script src="../src/physics/advanced/shapes/Poly.js"></script>
|
||||
<script src="../src/physics/advanced/shapes/Triangle.js"></script>
|
||||
<script src="../src/physics/advanced/shapes/Box.js"></script>
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* Phaser - http://www.phaser.io
|
||||
*
|
||||
* v1.0.0 - Built at: {buildDate}
|
||||
*
|
||||
* @author Richard Davey http://www.photonstorm.com @photonstorm
|
||||
*
|
||||
* A feature-packed 2D HTML5 game framework born from the smouldering pits of Flixel and
|
||||
* constructed via plenty of blood, sweat, tears and coffee by Richard Davey (@photonstorm).
|
||||
*
|
||||
* Phaser uses Pixi.js for rendering, created by Mat Groves http://matgroves.com/ @Doormat23.
|
||||
*
|
||||
* Follow Phaser development progress at http://www.photonstorm.com
|
||||
*
|
||||
* Many thanks to Adam Saltsman (@ADAMATOMIC) for releasing Flixel, from both which Phaser
|
||||
* and my love of game development originate.
|
||||
*
|
||||
* "If you want your children to be intelligent, read them fairy tales."
|
||||
* "If you want them to be more intelligent, read them more fairy tales."
|
||||
* -- Albert Einstein
|
||||
*/
|
||||
+5
-22
@@ -1,25 +1,3 @@
|
||||
/**
|
||||
* Phaser - http://www.phaser.io
|
||||
*
|
||||
* v1.0.0 - Released at some point during 2013
|
||||
*
|
||||
* @author Richard Davey http://www.photonstorm.com @photonstorm
|
||||
*
|
||||
* A feature-packed 2D HTML5 game framework born from the smouldering pits of Flixel and
|
||||
* constructed via plenty of blood, sweat, tears and coffee by Richard Davey (@photonstorm).
|
||||
*
|
||||
* Many thanks to Adam Saltsman (@ADAMATOMIC) for releasing Flixel, from both which Phaser
|
||||
* and my love of game development originate.
|
||||
*
|
||||
* Internally Phaser uses pixi.js by Mat Groves http://matgroves.com/ @Doormat23 for rendering.
|
||||
*
|
||||
* Follow Phaser development progress at http://www.photonstorm.com
|
||||
*
|
||||
* "If you want your children to be intelligent, read them fairy tales."
|
||||
* "If you want them to be more intelligent, read them more fairy tales."
|
||||
* -- Albert Einstein
|
||||
*/
|
||||
|
||||
/**
|
||||
* @module Phaser
|
||||
*/
|
||||
@@ -32,3 +10,8 @@ var Phaser = Phaser || {
|
||||
WEBGL: 2
|
||||
|
||||
};
|
||||
|
||||
PIXI.InteractionManager = function (dummy) {
|
||||
// We don't need this in Pixi, so we've removed it to save space
|
||||
// however the Stage object expects a reference to it, so here is a dummy entry.
|
||||
};
|
||||
@@ -0,0 +1,160 @@
|
||||
/**
|
||||
* Create a new <code>Button</code> object.
|
||||
*
|
||||
* @param game {Phaser.Game} Current game instance.
|
||||
* @param [x] {number} X position of the button.
|
||||
* @param [y] {number} Y position of the button.
|
||||
* @param [key] {string} The image key as defined in the Game.Cache to use as the texture for this button.
|
||||
* @param [callback] {function} The function to call when this button is pressed
|
||||
* @param [callbackContext] {object} The context in which the callback will be called (usually 'this')
|
||||
* @param [overFrame] {string|number} This is the frame or frameName that will be set when this button is in an over state. Give either a number to use a frame ID or a string for a frame name.
|
||||
* @param [outFrame] {string|number} This is the frame or frameName that will be set when this button is in an out state. Give either a number to use a frame ID or a string for a frame name.
|
||||
* @param [downFrame] {string|number} This is the frame or frameName that will be set when this button is in a down state. Give either a number to use a frame ID or a string for a frame name.
|
||||
*/
|
||||
Phaser.Button = function (game, x, y, key, callback, callbackContext, overFrame, outFrame, downFrame) {
|
||||
|
||||
x = x || 0;
|
||||
y = y || 0;
|
||||
key = key || null;
|
||||
callback = callback || null;
|
||||
callbackContext = callbackContext || this;
|
||||
overFrame = overFrame || null;
|
||||
outFrame = outFrame || null;
|
||||
downFrame = downFrame || null;
|
||||
|
||||
Phaser.Sprite.call(this, game, x, y, key, outFrame);
|
||||
|
||||
// this.texture = PIXI.TextureCache[key];
|
||||
|
||||
this._onOverFrameName = null;
|
||||
this._onOutFrameName = null;
|
||||
this._onDownFrameName = null;
|
||||
this._onUpFrameName = null;
|
||||
this._onOverFrameID = null;
|
||||
this._onOutFrameID = null;
|
||||
this._onDownFrameID = null;
|
||||
this._onUpFrameID = null;
|
||||
|
||||
if (typeof overFrame == 'string')
|
||||
{
|
||||
this._onOverFrameName = overFrame;
|
||||
}
|
||||
else
|
||||
{
|
||||
this._onOverFrameID = overFrame;
|
||||
}
|
||||
|
||||
if (typeof outFrame == 'string')
|
||||
{
|
||||
this._onOutFrameName = outFrame;
|
||||
this._onUpFrameName = outFrame;
|
||||
}
|
||||
else
|
||||
{
|
||||
this._onOutFrameID = outFrame;
|
||||
this._onUpFrameID = outFrame;
|
||||
}
|
||||
|
||||
if (typeof downFrame == 'string')
|
||||
{
|
||||
this._onDownFrameName = downFrame;
|
||||
}
|
||||
else
|
||||
{
|
||||
this._onDownFrameID = downFrame;
|
||||
}
|
||||
|
||||
// These are the signals the game will subscribe to
|
||||
this.onInputOver = new Phaser.Signal();
|
||||
this.onInputOut = new Phaser.Signal();
|
||||
this.onInputDown = new Phaser.Signal();
|
||||
this.onInputUp = new Phaser.Signal();
|
||||
|
||||
// Set a default signal for them
|
||||
if (callback)
|
||||
{
|
||||
this.onInputUp.add(callback, callbackContext);
|
||||
}
|
||||
|
||||
this.input.start(0, false, true);
|
||||
|
||||
// Redirect the input events to here so we can handle animation updates, etc
|
||||
this.events.onInputOver.add(this.onInputOverHandler, this);
|
||||
this.events.onInputOut.add(this.onInputOutHandler, this);
|
||||
this.events.onInputDown.add(this.onInputDownHandler, this);
|
||||
this.events.onInputUp.add(this.onInputUpHandler, this);
|
||||
|
||||
};
|
||||
|
||||
Phaser.Button.prototype = Phaser.Utils.extend(true, Phaser.Sprite.prototype, PIXI.Sprite.prototype);
|
||||
Phaser.Button.prototype.constructor = Phaser.Button;
|
||||
|
||||
// Add our own custom methods
|
||||
|
||||
Phaser.Button.prototype.onInputOverHandler = function (pointer) {
|
||||
|
||||
if (this._onOverFrameName != null)
|
||||
{
|
||||
this.frameName = this._onOverFrameName;
|
||||
}
|
||||
else if(this._onOverFrameID != null)
|
||||
{
|
||||
this.frame = this._onOverFrameID;
|
||||
}
|
||||
|
||||
if (this.onInputOver)
|
||||
{
|
||||
this.onInputOver.dispatch(this, pointer);
|
||||
}
|
||||
};
|
||||
|
||||
Phaser.Button.prototype.onInputOutHandler = function (pointer) {
|
||||
|
||||
if (this._onOutFrameName != null)
|
||||
{
|
||||
this.frameName = this._onOutFrameName;
|
||||
}
|
||||
else if (this._onOutFrameID != null)
|
||||
{
|
||||
this.frame = this._onOutFrameID;
|
||||
}
|
||||
|
||||
if (this.onInputOut)
|
||||
{
|
||||
this.onInputOut.dispatch(this, pointer);
|
||||
}
|
||||
};
|
||||
|
||||
Phaser.Button.prototype.onInputDownHandler = function (pointer) {
|
||||
|
||||
if (this._onDownFrameName != null)
|
||||
{
|
||||
this.frameName = this._onDownFrameName;
|
||||
}
|
||||
else if (this._onDownFrameID != null)
|
||||
{
|
||||
this.frame = this._onDownFrameID;
|
||||
}
|
||||
|
||||
if (this.onInputDown)
|
||||
{
|
||||
this.onInputDown.dispatch(this, pointer);
|
||||
}
|
||||
};
|
||||
|
||||
Phaser.Button.prototype.onInputUpHandler = function (pointer) {
|
||||
|
||||
if (this._onUpFrameName != null)
|
||||
{
|
||||
this.frameName = this._onUpFrameName;
|
||||
}
|
||||
else if (this._onUpFrameID != null)
|
||||
{
|
||||
this.frame = this._onUpFrameID;
|
||||
}
|
||||
|
||||
if (this.onInputUp)
|
||||
{
|
||||
this.onInputUp.dispatch(this, pointer);
|
||||
}
|
||||
};
|
||||
@@ -79,5 +79,10 @@ Phaser.GameObjectFactory.prototype = {
|
||||
|
||||
},
|
||||
|
||||
button: function (x, y, key, callback, callbackContext, overFrame, outFrame, downFrame) {
|
||||
|
||||
return this.world.add(new Phaser.Button(this.game, x, y, key, callback, callbackContext, overFrame, outFrame, downFrame));
|
||||
|
||||
},
|
||||
|
||||
};
|
||||
+42
-1
@@ -103,4 +103,45 @@ Phaser.Utils = {
|
||||
return target;
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
// Global functions that PIXI needs
|
||||
|
||||
/**
|
||||
* Converts a hex color number to an [R, G, B] array
|
||||
*
|
||||
* @method HEXtoRGB
|
||||
* @param hex {Number}
|
||||
*/
|
||||
function HEXtoRGB(hex) {
|
||||
return [(hex >> 16 & 0xFF) / 255, ( hex >> 8 & 0xFF) / 255, (hex & 0xFF)/ 255];
|
||||
}
|
||||
|
||||
/**
|
||||
* A polyfill for Function.prototype.bind
|
||||
*
|
||||
* @method bind
|
||||
*/
|
||||
if (typeof Function.prototype.bind != 'function') {
|
||||
Function.prototype.bind = (function () {
|
||||
var slice = Array.prototype.slice;
|
||||
return function (thisArg) {
|
||||
var target = this, boundArgs = slice.call(arguments, 1);
|
||||
|
||||
if (typeof target != 'function') throw new TypeError();
|
||||
|
||||
function bound() {
|
||||
var args = boundArgs.concat(slice.call(arguments));
|
||||
target.apply(this instanceof bound ? this : thisArg, args);
|
||||
}
|
||||
|
||||
bound.prototype = (function F(proto) {
|
||||
proto && (F.prototype = proto);
|
||||
if (!(this instanceof F)) return new F;
|
||||
})(target.prototype);
|
||||
|
||||
return bound;
|
||||
};
|
||||
})();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user