From 6e4631a84949c7f1d55045754c3f426fd270d21d Mon Sep 17 00:00:00 2001 From: Webeled Date: Thu, 19 Sep 2013 10:36:15 +0200 Subject: [PATCH 1/4] First commit of the day --- Docs/Documentation Checklist.xlsx | Bin 10438 -> 5736 bytes examples/camera/moving the game camera.php | 6 +-- examples/display/render crisp.php | 10 +++-- src/core/Camera.js | 41 ++++++++++++++++++--- 4 files changed, 44 insertions(+), 13 deletions(-) diff --git a/Docs/Documentation Checklist.xlsx b/Docs/Documentation Checklist.xlsx index 09a7b4475470f36db257a49c1a6074d54e3d4b5b..a38b051275697c25ea7082ee039d3a8779530eed 100644 GIT binary patch literal 5736 zcmb7I1yqz>x273NkQ~xax`&}e1QC#-r9nD}kO^c60cj8WBq0%nD6G!P#6j% zc=cWqJEVdOrU=>b4vY43e@k=UrV1T8oT}vQmo#u;c`I3n-qqVH5MWf0M;N8-vp;xC zK4p&5_Ao3>F${t%G~$bRaR&6t$+-4?ixKT;Fv#{^Uxl6Ay037o19tFNECRcdQE1Xc ztNo#wbq36VbAIj4bq?^GtVj*vh{$d;WSV|QsS4R?sgj@MlJ2r?QIL%$5a z9G=*3Ryy1ijob|FkS8T5%*G3D>vRL4{m;K{f1=kP%${Gg=ZGr5L0Qy9HR(sE3^J

J2o3*kNGPT zPiBxa!jr0V)P+VtHk85s#rnLU!fu7*lhMO62cRft(O$7`yh)HoCDDSQZ}N?}i)mP{ zsK1z|Sh$n5+PSSHT%WOiFy(n66zVvxf)ugVI9#qSs2SKh%7)+0)1ua>HPi}D55Dz7 z5te`0@UWM!W*QEKO0pRxBv+_gShu@iy&t;>gnmci|`jK_`;ErcMroY({NeyTHQ* zt4HUT6|ztCj~8<89f#+%dR`h9@iTBQo5k;%(JS@^89=iQIHN0%_2LG*f;rITctoo2 zX+;n*p3Gy_6R%jIB4vHH=t_ER2y58~CA{OXa)~8_S-%pz@Eo5`Eegd7i55-Hd(eOi zwKL~rtRx~%k=<}x92h6?{fg_xS#}+;qw}H3l86gMC^KF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2bu+6EROVGoFMAY^=WllM-f|{2HedDN7tYQPPum{j z#VUYja5H_pM@-?V4dI#{o3=^K^C@0nXOoNfC2LQ;wEB=oI*6t!gH&;$f_OSHht_#9 z4p=lVS;I=9qDEjlPaHO=BfyK`$gRwf+t+0y{{CTLVB;xPK!o)K*_kJ?kxLG`tIX>z zH$BtV(SgLZ<{%V-zPNGtdql>s#89fQ_}HRR-X)8^p5`%FQaR4# z&j!OKUJDw(J$!ruoz~wBYk#Q`lb0x$d-Aa(jqWSaiaZtVT1#%Pb{mGVr~Xa><)ImC zJ{h7Lt@(Yh^IpZh3~zgt(T#W{J`K=u-ENgF(`> zF!W)bd$j&`t$nbE`%qv5`Yz-Nu?_#6!$nc7*)Yf)0-*r_)W2E|eOufA84ie0|8bryyl*aB)M}HojF!z{?T=#Ij zk&xCV=F>fk8SPXG-N?p(d5Uj|eUVtdbYFi(he&~Lv1a&Ah5)Lw_Tfs@+FmZE7Yd62 zSb@g)N>e)YbKuaj-^N!NbO+Or`7gLu29<1!FE z^8}TyH^`hP$>HdW^T%_04qH1A!4oP}tRbLFl)!Sii6L9F_?I;FXk_%GfNH|4eD*ER zwZ!Y(H?w;)l;}|mX~iFz1XjJ~I`PGizYKx1<~~!24>H?oUYciu+~Q|ZNcW}!1Sf_w z>b@Ocp^T$U_m{l5E?RdTB^-b(`v2c`^nc*|QcnGe^a!!6zZ6%0CH}Qm_LEo_ z={MqkRL*`y__f~f6G8j=e_sFpt3Lb+_-p$9C!j8*S`6Xm*JS>$0Keu=egcqV{m#>W zGAX~3{<=KYtDRKp)v(zUdFUtt1NrkwE|e8S Date: Thu, 19 Sep 2013 13:17:49 +0200 Subject: [PATCH 2/4] Updated my files and the documentation checklist --- Docs/Documentation Checklist.xlsx | Bin 5736 -> 5746 bytes src/core/Camera.js | 100 +++++++++++++++++++++++++----- src/core/Stage.js | 91 ++++++++++++++++++++++----- src/core/World.js | 95 +++++++++++++++++++++------- src/gameobjects/Button.js | 9 ++- 5 files changed, 239 insertions(+), 56 deletions(-) diff --git a/Docs/Documentation Checklist.xlsx b/Docs/Documentation Checklist.xlsx index a38b051275697c25ea7082ee039d3a8779530eed..292dcd33ea46be15c4cd9a1269bd9b444751bd79 100644 GIT binary patch delta 2632 zcmaJ@XEYpW7oO4kVulG3f*7L5h!Qnw^cgaGn_V-j8&O8hWR-|cW{@Ewh~C>6qL+lI ziLg2mH3@>nBKXKT-}!d`eD9z8-sgRubMKFP&-<)P?n<)2ji_nB00ssI0LG?<1p=hP z*wl#tuUtlg1{EAnJ>`A;XAaFXktc%%GIImkEFXlzaU$v-sG6`7ubfbQn{kr3r8hUeK!8A_3A1P>cMkqgR{OXi0iVUy7nY)k3!#_&kivo@?>Q#y= zO=e$6;%JmRxpZ1|`nhHDUURw2Qw7N8o-%6$w#}@z%Li{4WYJp4+AxQ?8eE_d(<(j{cvMkC7@Y>pMUq&Lrd4Hwtgm?oGNm3BYk#O?McyTERtQ=2+R)9< z24-|8HIPYFY=8XNM@`XU?X~&IiOJKfl&8)?XZRX7PkZ-BJVCWY8`MpnplRT670!8< zobQ?DptEWywthzvq;gXQlF)uGABpxl>8v;TC3&ct)aiacgBl>zlHaelOrzbzJNv_T zht}nCY~F`W9QTJnCMmB%8h35v<9SdVTwxq3x~?h@!w2d;NTv;gm?&u_K}27^rsTtN zJbI#G5Ncbvlkix6NyxefXg4b0LBdJx#ikpmf>7+eEv&JB*Q6V0>i$W2=BoNa>iTdY z0h2IOkh1o4Nc_CY!&bixGK;?GT0j*Ni0Hex(1Ra9qWN$lU8w!x zIeeP(TN5EZc%Q?d?{bdNBfr@dKK--XRB$1CB6c?I34r*7k+_Iq0E%&d#5#xAfBh~o zMq`MDMFEHm5D_XxZ3c>6bZBGTdml2yLV@yOv2|=f-RNk)@<%egE-Rp7|m)iG7mK zwEAf6Mp7^HG+-zwQET3)+qGFOV(X)yp*Pa z>K~l5D+VlLu?|F?3)L0N?3&kK60ic!y&X-HEB5lk?0cQ7bG7f7!tE4hj#{&gzl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PkwD8@#`D60xXt90U3jXl%0a(~(?4s?x@itB~s)K)}e))ywpRq}e_d&MgJL z5A!PM`jPfZ)vT{WNYzo--?+y55OJA!Au9Qk{6!Y!=lH1zR6+lmZ~pvrTyTY+mmOr= zQJ}HpZdVs!Bh9giK@mYbF$)qrOB8@hU)g@n*1GovbJ1}hctTI_IUl3Q7N0Y1VP)@L zcG^>}NDPI-m7L4>iiKYUO9MxX%nF5Yy|FE20)cec|9i3P=^W#~EL9yB3-ht1YUY_a zc39cGh+lLQ%>S3uI>)bm{OZAv=7#92=>2miY0dl^r;n+BcQ`(fe}bNNQb6LD2JC@; znGFVkhK?pV`H$eJ>QA!}5IgShhX4YcmzFGmI0ltRpg3(n;Pf&0as;B&SOtGO2C{+( Oa8VjsPzu8LtJ&WyqNU>i diff --git a/src/core/Camera.js b/src/core/Camera.js index 9f34a911..22cdbe23 100644 --- a/src/core/Camera.js +++ b/src/core/Camera.js @@ -1,10 +1,16 @@ /** -* Phaser - Camera +* @author Richard Davey +* @copyright 2013 Photon Storm Ltd. +* @license https://github.com/photonstorm/phaser/blob/master/license.txt MIT License +* @module Phaser.Camera +*/ + +/** * * A Camera is your view into the game world. It has a position and size and renders only those objects within its field of view. * The game automatically creates a single Stage sized camera on boot. Move the camera around the world with Phaser.Camera.x/y * -* @class Phaser.Camera +* @class Camera * @constructor * @param {Phaser.Game} game game reference to the currently running game. * @param {number} id not being used at the moment, will be when Phaser supports multiple camera @@ -16,38 +22,60 @@ Phaser.Camera = function (game, id, x, y, width, height) { + /** + * A reference to the currently running Game. + * @property game + * @public + * @type {Phaser.Game} + */ this.game = game; + + /** + * A reference to the game world + * @property world + * @public + * @type {Phaser.World} + */ this.world = game.world; - this.id = 0; // reserved for future multiple camera set-ups - - // The view into the world we wish to render (by default the game dimensions) - // The x/y values are in world coordinates, not screen coordinates, the width/height is how many pixels to render - // Objects outside of this view are not rendered (unless set to ignore the Camera, i.e. UI?) + + /** + * reserved for future multiple camera set-ups + * @property id + * @public + * @type {number} + */ + this.id = 0; /** * Camera view. + * The view into the world we wish to render (by default the game dimensions) + * The x/y values are in world coordinates, not screen coordinates, the width/height is how many pixels to render + * Objects outside of this view are not rendered (unless set to ignore the Camera, i.e. UI?) * @property view - * @type {Rectangle} + * @public + * @type {Phaser.Rectangle} */ this.view = new Phaser.Rectangle(x, y, width, height); /** * Used by Sprites to work out Camera culling. * @property screenView - * @type {Rectangle} + * @public + * @type {Phaser.Rectangle} */ this.screenView = new Phaser.Rectangle(x, y, width, height); /** * Sprite moving inside this Rectangle will not cause camera moving. * @property deadzone - * @type {Rectangle} + * @type {Phaser.Rectangle} */ this.deadzone = null; /** * Whether this camera is visible or not. (default is true) * @property visible + * @public * @default true * @type {bool} */ @@ -63,10 +91,17 @@ Phaser.Camera = function (game, id, x, y, width, height) { /** * If the camera is tracking a Sprite, this is a reference to it, otherwise null * @property target - * @type {Sprite} + * @public + * @type {Phaser.Sprite} */ this.target = null; + /** + * Edge property + * @property edge + * @private + * @type {number} + */ this._edge = 0; }; @@ -82,7 +117,7 @@ Phaser.Camera.prototype = { /** * Tells this camera which sprite to follow. * @method follow - * @param target {Sprite} The object you want the camera to track. Set to null to not follow anything. + * @param target {Phaser.Sprite} The object you want the camera to track. Set to null to not follow anything. * @param [style] {number} Leverage one of the existing "deadzone" presets. If you use a custom deadzone, ignore this parameter and manually specify the deadzone after calling follow(). */ follow: function (target, style) { @@ -120,7 +155,7 @@ Phaser.Camera.prototype = { }, /** - * Move the camera focus to this location instantly. + * Move the camera focus to a location instantly. * @method focusOnXY * @param x {number} X position. * @param y {number} Y position. @@ -237,11 +272,11 @@ Phaser.Camera.prototype = { }, /** - * Sets the size of the view rectangle + * Sets the size of the view rectangle given the width and height in parameters * * @method setSize - * @param x {number} X position. - * @param y {number} Y position. + * @param width {number} the desired width. + * @param height {number} the desired height. */ setSize: function (width, height) { @@ -254,10 +289,17 @@ Phaser.Camera.prototype = { Object.defineProperty(Phaser.Camera.prototype, "x", { + /** + * @method x + * @return {Number} The x position + */ get: function () { return this.view.x; }, - + /** + * @method x + * @return {Number} Sets the camera's x position and clamp it if it's outside the world bounds + */ set: function (value) { this.view.x = value; this.checkWorldBounds(); @@ -267,10 +309,18 @@ Object.defineProperty(Phaser.Camera.prototype, "x", { Object.defineProperty(Phaser.Camera.prototype, "y", { + /** + * @method y + * @return {Number} The y position + */ get: function () { return this.view.y; }, + /** + * @method y + * @return {Number} Sets the camera's y position and clamp it if it's outside the world bounds + */ set: function (value) { this.view.y = value; this.checkWorldBounds(); @@ -280,10 +330,18 @@ Object.defineProperty(Phaser.Camera.prototype, "y", { Object.defineProperty(Phaser.Camera.prototype, "width", { + /** + * @method width + * @return {Number} The width of the view rectangle, in pixels + */ get: function () { return this.view.width; }, + /** + * @method width + * @return {Number} Sets the width of the view rectangle + */ set: function (value) { this.view.width = value; } @@ -292,10 +350,18 @@ Object.defineProperty(Phaser.Camera.prototype, "width", { Object.defineProperty(Phaser.Camera.prototype, "height", { + /** + * @method height + * @return {Number} The height of the view rectangle, in pixels + */ get: function () { return this.view.height; }, + /** + * @method height + * @return {Number} Sets the height of the view rectangle + */ set: function (value) { this.view.height = value; } diff --git a/src/core/Stage.js b/src/core/Stage.js index 5a4e07e6..eefe3ded 100644 --- a/src/core/Stage.js +++ b/src/core/Stage.js @@ -1,15 +1,15 @@ /** - * Stage - * - * The Stage controls the canvas on which everything is displayed. It handles display within the browser, - * focus handling, game resizing, scaling and the pause, boot and orientation screens. - * - * @package Phaser.Stage - * @author Richard Davey - * @copyright 2013 Photon Storm Ltd. - * @license https://github.com/photonstorm/phaser/blob/master/license.txt MIT License - +* @author Richard Davey +* @copyright 2013 Photon Storm Ltd. +* @license https://github.com/photonstorm/phaser/blob/master/license.txt MIT License +* @module Phaser.Stage +*/ +/** +* +* The Stage controls the canvas on which everything is displayed. It handles display within the browser, +* focus handling, game resizing, scaling and the pause, boot and orientation screens. +* * @class Stage * @constructor * @param game {Phaser.Game} game reference to the currently running game. @@ -17,33 +17,81 @@ * @param height {number} height of the canvas element */ Phaser.Stage = function (game, width, height) { - + + /** + * A reference to the currently running Game. + * @property game + * @public + * @type {Phaser.Game} + */ this.game = game; /** * Background color of the stage (defaults to black). Set via the public backgroundColor property. + * @property _backgroundColor + * @private * @type {string} */ this._backgroundColor = 'rgb(0,0,0)'; - // Get the offset values (for input and other things) + /** + * Get the offset values (for input and other things) + * @property offset + * @public + * @type {Phaser.Point} + */ this.offset = new Phaser.Point; - + + /** + * reference to the newly created element + * @property canvas + * @public + * @type {HTMLCanvasElement} + */ this.canvas = Phaser.Canvas.create(width, height); this.canvas.style['-webkit-full-screen'] = 'width: 100%; height: 100%'; - - // The Pixi Stage which is hooked to the renderer + + /** + * The Pixi Stage which is hooked to the renderer + * @property _stage + * @private + * @type {PIXI.Stage} + */ this._stage = new PIXI.Stage(0x000000, false); this._stage.name = '_stage_root'; - + + /** + * The current scaleMode + * @property scaleMode + * @public + * @type {Phaser.StageScaleMode} + */ this.scaleMode = Phaser.StageScaleMode.NO_SCALE; + + /** + * The scale of the current running game + * @property scale + * @public + * @type {Phaser.StageScaleMode} + */ this.scale = new Phaser.StageScaleMode(this.game, width, height); + + /** + * aspect ratio + * @property aspectRatio + * @public + * @type {number} + */ this.aspectRatio = width / height; }; Phaser.Stage.prototype = { + /** + * Initialises the stage and adds the event listeners + * @method boot + */ boot: function () { Phaser.Canvas.getOffset(this.canvas, this.offset); @@ -68,6 +116,8 @@ Phaser.Stage.prototype = { /** * This method is called when the document visibility is changed. + * @method visibilityChange + * @param event [Event] its type will be used to decide whether the game should be paused or not */ visibilityChange: function (event) { @@ -93,10 +143,19 @@ Phaser.Stage.prototype = { Object.defineProperty(Phaser.Stage.prototype, "backgroundColor", { + /** + * @method backgroundColor + * @return {string} returns the background color of the stage + */ get: function () { return this._backgroundColor; }, + /** + * @method backgroundColor + * @param {string} the background color you want the stage to have + * @return {string} returns the background color of the stage + */ set: function (color) { this._backgroundColor = color; diff --git a/src/core/World.js b/src/core/World.js index 36319967..a0e79906 100644 --- a/src/core/World.js +++ b/src/core/World.js @@ -1,5 +1,11 @@ /** - * World +* @author Richard Davey +* @copyright 2013 Photon Storm Ltd. +* @license https://github.com/photonstorm/phaser/blob/master/license.txt MIT License +* @module Phaser.World +*/ + +/** * * "This world is but a canvas to our imagination." - Henry David Thoreau * @@ -7,11 +13,6 @@ * by stage limits and can be any size. You look into the world via cameras. All game objects live within * the world at world-based coordinates. By default a world is created the same size as your Stage. * - * @package Phaser.World - * @author Richard Davey - * @copyright 2013 Photon Storm Ltd. - * @license https://github.com/photonstorm/phaser/blob/master/license.txt MIT License - * @class World * @constructor * @param game {Phaser.Game} reference to the current game instance. @@ -19,38 +20,55 @@ Phaser.World = function (game) { /** - * Local reference to Game. - */ + * A reference to the currently running Game. + * @property game + * @public + * @type {Phaser.Game} + */ this.game = game; /** - * Bound of this world that objects can not escape from. - * @type {Rectangle} - */ + * Bound of this world that objects can not escape from. + * @property bounds + * @public + * @type {Phaser.Rectangle} + */ this.bounds = new Phaser.Rectangle(0, 0, game.width, game.height); /** - * Camera instance. - * @type {Camera} - */ + * Camera instance. + * @property camera + * @public + * @type {Phaser.Camera} + */ this.camera = null; /** - * Reset each frame, keeps a count of the total number of objects updated. - * @type {Number} - */ + * Reset each frame, keeps a count of the total number of objects updated. + * @property currentRenderOrderID + * @public + * @type {Number} + */ this.currentRenderOrderID = 0; /** - * Object container stores every object created with `create*` methods. - * @type {Group} - */ + * Object container stores every object created with `create*` methods. + * @property group + * @public + * @type {Phaser.Group} + */ this.group = null; }; Phaser.World.prototype = { + + /** + * Initialises the game world + * + * @method boot + */ boot: function () { this.camera = new Phaser.Camera(this.game, 0, 0, 0, this.game.width, this.game.height); @@ -62,8 +80,9 @@ Phaser.World.prototype = { }, /** - * This is called automatically every frame, and is where main logic happens. - */ + * This is called automatically every frame, and is where main logic happens. + * @method update + */ update: function () { this.camera.update(); @@ -134,10 +153,18 @@ Phaser.World.prototype = { Object.defineProperty(Phaser.World.prototype, "width", { + /** + * @method width + * @return {Number} The current width of the game world + */ get: function () { return this.bounds.width; }, + /** + * @method width + * @return {Number} Sets the width of the game world + */ set: function (value) { this.bounds.width = value; } @@ -146,10 +173,18 @@ Object.defineProperty(Phaser.World.prototype, "width", { Object.defineProperty(Phaser.World.prototype, "height", { + /** + * @method height + * @return {Number} The current height of the game world + */ get: function () { return this.bounds.height; }, + /** + * @method height + * @return {Number} Sets the width of the game world + */ set: function (value) { this.bounds.height = value; } @@ -158,6 +193,10 @@ Object.defineProperty(Phaser.World.prototype, "height", { Object.defineProperty(Phaser.World.prototype, "centerX", { + /** + * @method centerX + * @return {Number} return the X position of the center point of the world + */ get: function () { return this.bounds.halfWidth; } @@ -166,6 +205,10 @@ Object.defineProperty(Phaser.World.prototype, "centerX", { Object.defineProperty(Phaser.World.prototype, "centerY", { + /** + * @method centerY + * @return {Number} return the Y position of the center point of the world + */ get: function () { return this.bounds.halfHeight; } @@ -174,6 +217,10 @@ Object.defineProperty(Phaser.World.prototype, "centerY", { Object.defineProperty(Phaser.World.prototype, "randomX", { + /** + * @method randomX + * @return {Number} a random integer which is lesser or equal to the current width of the game world + */ get: function () { return Math.round(Math.random() * this.bounds.width); } @@ -182,6 +229,10 @@ Object.defineProperty(Phaser.World.prototype, "randomX", { Object.defineProperty(Phaser.World.prototype, "randomY", { + /** + * @method randomY + * @return {Number} a random integer which is lesser or equal to the current height of the game world + */ get: function () { return Math.round(Math.random() * this.bounds.height); } diff --git a/src/gameobjects/Button.js b/src/gameobjects/Button.js index 9aea5634..b5335152 100644 --- a/src/gameobjects/Button.js +++ b/src/gameobjects/Button.js @@ -1,3 +1,10 @@ +/** +* @author Richard Davey +* @copyright 2013 Photon Storm Ltd. +* @license https://github.com/photonstorm/phaser/blob/master/license.txt MIT License +* @module Phaser.Button +*/ + /** * Create a new Button object. * @class Button @@ -15,6 +22,7 @@ */ Phaser.Button = function (game, x, y, key, callback, callbackContext, overFrame, outFrame, downFrame) { + x = x || 0; y = y || 0; key = key || null; @@ -69,7 +77,6 @@ Phaser.Button.prototype.constructor = Phaser.Button; * @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.prototype.setFrames = function (overFrame, outFrame, downFrame) { if (overFrame !== null) From 26a595cd449833c8ce5d7994c19b6c1531f599ba Mon Sep 17 00:00:00 2001 From: Webeled Date: Thu, 19 Sep 2013 16:34:48 +0200 Subject: [PATCH 3/4] JSDocs update ;) --- src/core/Camera.js | 16 ++--- src/core/Stage.js | 10 ++-- src/core/World.js | 6 +- src/gameobjects/Button.js | 24 ++++---- src/sound/Sound.js | 120 +++++++++++++++++++++++++++++++++----- src/sound/SoundManager.js | 84 ++++++++++++++++++++++---- src/system/Canvas.js | 20 ++++++- src/utils/Utils.js | 38 ++++++++++-- 8 files changed, 261 insertions(+), 57 deletions(-) diff --git a/src/core/Camera.js b/src/core/Camera.js index 22cdbe23..e5da9e26 100644 --- a/src/core/Camera.js +++ b/src/core/Camera.js @@ -117,8 +117,8 @@ Phaser.Camera.prototype = { /** * Tells this camera which sprite to follow. * @method follow - * @param target {Phaser.Sprite} The object you want the camera to track. Set to null to not follow anything. - * @param [style] {number} Leverage one of the existing "deadzone" presets. If you use a custom deadzone, ignore this parameter and manually specify the deadzone after calling follow(). + * @param {Phaser.Sprite} target The object you want the camera to track. Set to null to not follow anything. + * @param {number} [style] Leverage one of the existing "deadzone" presets. If you use a custom deadzone, ignore this parameter and manually specify the deadzone after calling follow(). */ follow: function (target, style) { @@ -157,8 +157,8 @@ Phaser.Camera.prototype = { /** * Move the camera focus to a location instantly. * @method focusOnXY - * @param x {number} X position. - * @param y {number} Y position. + * @param {number} x X position. + * @param {number} y Y position. */ focusOnXY: function (x, y) { @@ -260,8 +260,8 @@ Phaser.Camera.prototype = { * without having to use game.camera.x and game.camera.y * * @method setPosition - * @param x {number} X position. - * @param y {number} Y position. + * @param {number} x X position. + * @param {number} y Y position. */ setPosition: function (x, y) { @@ -275,8 +275,8 @@ Phaser.Camera.prototype = { * Sets the size of the view rectangle given the width and height in parameters * * @method setSize - * @param width {number} the desired width. - * @param height {number} the desired height. + * @param {number} width The desired width. + * @param {number} height The desired height. */ setSize: function (width, height) { diff --git a/src/core/Stage.js b/src/core/Stage.js index eefe3ded..73ea9392 100644 --- a/src/core/Stage.js +++ b/src/core/Stage.js @@ -12,9 +12,9 @@ * * @class Stage * @constructor -* @param game {Phaser.Game} game reference to the currently running game. -* @param width {number} width of the canvas element -* @param height {number} height of the canvas element +* @param {Phaser.Game} game Game reference to the currently running game. +* @param {number} width Width of the canvas element +* @param {number} height Height of the canvas element */ Phaser.Stage = function (game, width, height) { @@ -64,7 +64,7 @@ Phaser.Stage = function (game, width, height) { * The current scaleMode * @property scaleMode * @public - * @type {Phaser.StageScaleMode} + * @type {number} */ this.scaleMode = Phaser.StageScaleMode.NO_SCALE; @@ -117,7 +117,7 @@ Phaser.Stage.prototype = { /** * This method is called when the document visibility is changed. * @method visibilityChange - * @param event [Event] its type will be used to decide whether the game should be paused or not + * @param {Event} event Its type will be used to decide whether the game should be paused or not */ visibilityChange: function (event) { diff --git a/src/core/World.js b/src/core/World.js index a0e79906..4fbbd8c6 100644 --- a/src/core/World.js +++ b/src/core/World.js @@ -15,7 +15,7 @@ * * @class World * @constructor - * @param game {Phaser.Game} reference to the current game instance. + * @param {Phaser.Game} game Reference to the current game instance. */ Phaser.World = function (game) { @@ -115,8 +115,8 @@ Phaser.World.prototype = { /** * Updates the size of this world. * @method setSize - * @param width {number} New width of the world. - * @param height {number} New height of the world. + * @param {number} width New width of the world. + * @param {number} height New height of the world. */ setSize: function (width, height) { diff --git a/src/gameobjects/Button.js b/src/gameobjects/Button.js index b5335152..325fee20 100644 --- a/src/gameobjects/Button.js +++ b/src/gameobjects/Button.js @@ -10,15 +10,15 @@ * @class Button * @constructor * -* @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. +* @param {Phaser.Game} game Current game instance. +* @param {number} [x] X position of the button. +* @param {number} [y] Y position of the button. +* @param {string} [key] The image key as defined in the Game.Cache to use as the texture for this button. +* @param {function} [callback] The function to call when this button is pressed +* @param {object} [callbackContext] The context in which the callback will be called (usually 'this') +* @param {string|number} [overFrame] 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 {string|number} [outFrame] 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 {string|number} [downFrame] 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) { @@ -73,9 +73,9 @@ Phaser.Button.prototype.constructor = Phaser.Button; * exactly like setting them in the constructor * * @method setFrames -* @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. +* @param {string|number} [overFrame] 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 {string|number} [outFrame] 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 {string|number} [downFrame] 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.prototype.setFrames = function (overFrame, outFrame, downFrame) { diff --git a/src/sound/Sound.js b/src/sound/Sound.js index e51264ae..d45543f7 100644 --- a/src/sound/Sound.js +++ b/src/sound/Sound.js @@ -3,26 +3,70 @@ * * @class Sound * @constructor -* @param game {Phaser.Game} reference to the current game instance. -* @param key {string} Asset key for the sound. -* @param volume {number} default value for the volume. -* @param loop {bool} Whether or not the sound will loop. +* @param {Phaser.Game} game Reference to the current game instance. +* @param {string} key Asset key for the sound. +* @param {number} volume Default value for the volume. +* @param {bool} loop Whether or not the sound will loop. */ Phaser.Sound = function (game, key, volume, loop) { volume = volume || 1; if (typeof loop == 'undefined') { loop = false; } + /** + * A reference to the currently running Game. + * @property game + * @public + * @type {Phaser.Game} + */ this.game = game; + + /** + * Name of the sound + * @property name + * @public + * @type {string} + */ this.name = ''; + + /** + * Asset key for the sound. + * @property key + * @public + * @type {string} + */ this.key = key; + + /** + * Whether or not the sound will loop. + * @property loop + * @public + * @type {bool} + */ this.loop = loop; + + /** + * The global audio volume. A value between 0 (silence) and 1 (full volume) + * @property _volume + * @private + * @type {number} + */ this._volume = volume; + + /** + * The sound markers, empty by default + * @property markers + * @public + * @type {object} + */ this.markers = {}; /** * Reference to AudioContext instance. + * @property context + * @public + * @type {AudioContext} */ this.context = null; @@ -31,9 +75,28 @@ Phaser.Sound = function (game, key, volume, loop) { */ this._buffer = null; + /** + * Boolean indicating whether the game is on "mute" + * @property _muted + * @private + * @type {bool} + */ this._muted = false; + /** + * Boolean indicating whether the sound should start automatically + * @property autoplay + * @public + * @type {bool} + */ this.autoplay = false; + + /** + * The total duration of the sound, in milliseconds + * @property autoplay + * @public + * @type {bool} + */ this.totalDuration = 0; this.startTime = 0; this.currentTime = 0; @@ -188,11 +251,11 @@ Phaser.Sound.prototype = { /** * Play this sound, or a marked section of it. - - * @param marker {string} Assets key of the sound you want to play. - * @param position {number} the starting position - * @param [volume] {number} volume of the sound you want to play. - * @param [loop] {bool} loop when it finished playing? (Default to false) + * @method play + * @param {string} marker Assets key of the sound you want to play. + * @param {number} position The starting position + * @param {number} [volume] Volume of the sound you want to play. + * @param {bool} [loop] Loop when it finished playing? (Default to false) * @return {Sound} The playing sound object. */ play: function (marker, position, volume, loop, forceRestart) { @@ -366,6 +429,14 @@ Phaser.Sound.prototype = { } }, + /** + * Restart the sound, or a marked section of it. + * @method restart + * @param {string} marker Assets key of the sound you want to play. + * @param {number} position The starting position + * @param {number} [volume] Volume of the sound you want to play. + * @param {bool} [loop] Loop when it finished playing? (Default to false) + */ restart: function (marker, position, volume, loop) { marker = marker || ''; @@ -377,6 +448,10 @@ Phaser.Sound.prototype = { }, + /** + * Pauses the sound + * @method pause + */ pause: function () { if (this.isPlaying && this._sound) @@ -388,7 +463,10 @@ Phaser.Sound.prototype = { } }, - + /** + * Resumes the sound + * @method pause + */ resume: function () { if (this.paused && this._sound) @@ -419,6 +497,7 @@ Phaser.Sound.prototype = { /** * Stop playing this sound. + * @method stop */ stop: function () { @@ -470,13 +549,20 @@ Object.defineProperty(Phaser.Sound.prototype, "isDecoded", { Object.defineProperty(Phaser.Sound.prototype, "mute", { - /** - * Mute sounds. + + /** + * Mutes sound. + * @method mute + * @return {bool} whether or not the sound is muted */ get: function () { return this._muted; }, - + /** + * Mutes sound. + * @method mute + * @return {bool} whether or not the sound is muted + */ set: function (value) { value = value || null; @@ -518,10 +604,18 @@ Object.defineProperty(Phaser.Sound.prototype, "mute", { Object.defineProperty(Phaser.Sound.prototype, "volume", { + /** + * @method volume + * @return {number} The current volume. A value between 0 (silence) and 1 (full volume) + */ get: function () { return this._volume; }, + /** + * @method volume + * @return {number} Sets the current volume. A value between 0 (silence) and 1 (full volume) + */ set: function (value) { if (this.usingWebAudio) diff --git a/src/sound/SoundManager.js b/src/sound/SoundManager.js index 88501bbb..5464b6f6 100644 --- a/src/sound/SoundManager.js +++ b/src/sound/SoundManager.js @@ -3,20 +3,47 @@ * * @class SoundManager * @constructor -* @param game {Phaser.Game} reference to the current game instance. +* @param {Phaser.Game} game reference to the current game instance. */ Phaser.SoundManager = function (game) { + /** + * A reference to the currently running Game. + * @property game + * @public + * @type {Phaser.Game} + */ this.game = game; this.onSoundDecode = new Phaser.Signal; + + /** + * Boolean indicating whether the game is on "mute" + * @property _muted + * @private + * @type {bool} + */ this._muted = false; this._unlockSource = null; + + /** + * The global audio volume. A value between 0 (silence) and 1 (full volume) + * @property _volume + * @private + * @type {number} + */ this._volume = 1; - this._muted = false; + + /** + * An array containing all the sounds + * @property _sounds + * @private + * @type {array} + */ this._sounds = []; + this.context = null; this.usingWebAudio = true; this.usingAudioTag = false; @@ -30,6 +57,10 @@ Phaser.SoundManager = function (game) { Phaser.SoundManager.prototype = { + /** + * Initialises the sound manager + * @method boot + */ boot: function () { if (this.game.device.iOS && this.game.device.webAudio == false) @@ -108,6 +139,10 @@ Phaser.SoundManager.prototype = { }, + /** + * Enables the audio, usually after the first touch + * @method unlock + */ unlock: function () { if (this.touchLocked == false) @@ -138,6 +173,10 @@ Phaser.SoundManager.prototype = { }, + /** + * Stops all the sounds in the game + * @method stopAll + */ stopAll: function () { for (var i = 0; i < this._sounds.length; i++) @@ -150,6 +189,10 @@ Phaser.SoundManager.prototype = { }, + /** + * Pauses all the sounds in the game + * @method pauseAll + */ pauseAll: function () { for (var i = 0; i < this._sounds.length; i++) @@ -162,6 +205,10 @@ Phaser.SoundManager.prototype = { }, + /** + * resumes every sound in the game + * @method resumeAll + */ resumeAll: function () { for (var i = 0; i < this._sounds.length; i++) @@ -176,8 +223,9 @@ Phaser.SoundManager.prototype = { /** * Decode a sound with its assets key. + * @method decode * @param key {string} Assets key of the sound to be decoded. - * @param [sound] {Sound} its bufer will be set to decoded data. + * @param [sound] {Phaser.Sound} its bufer will be set to decoded data. */ decode: function (key, sound) { @@ -205,6 +253,10 @@ Phaser.SoundManager.prototype = { }, + /** + * updates every sound in the game + * @method update + */ update: function () { if (this.touchLocked) @@ -232,11 +284,10 @@ Phaser.SoundManager.prototype = { /** * * @method add - * @param key {string} Asset key for the sound. - * @param volume {number} default value for the volume. - * @param loop {bool} Whether or not the sound will loop. + * @param {string} key Asset key for the sound. + * @param {number} volume Default value for the volume. + * @param {bool} loop Whether or not the sound will loop. */ - add: function (key, volume, loop) { volume = volume || 1; @@ -258,6 +309,8 @@ Object.defineProperty(Phaser.SoundManager.prototype, "mute", { /** * A global audio mute toggle. + * @method mute + * @return {bool} whether or not the game is on "mute" */ get: function () { @@ -265,6 +318,11 @@ Object.defineProperty(Phaser.SoundManager.prototype, "mute", { }, + /** + * Mute sounds. + * @method mute + * @return {bool} whether or not the game is on "mute" + */ set: function (value) { value = value || null; @@ -316,14 +374,16 @@ Object.defineProperty(Phaser.SoundManager.prototype, "mute", { } } } - }, + } - enumerable: true, - configurable: true }); Object.defineProperty(Phaser.SoundManager.prototype, "volume", { + /** + * @method volume + * @return {number} The global audio volume. A value between 0 (silence) and 1 (full volume) + */ get: function () { if (this.usingWebAudio) @@ -338,7 +398,9 @@ Object.defineProperty(Phaser.SoundManager.prototype, "volume", { }, /** - * The global audio volume. A value between 0 (silence) and 1 (full volume) + * Sets the global volume + * @method volume + * @return {number} The global audio volume. A value between 0 (silence) and 1 (full volume) */ set: function (value) { diff --git a/src/system/Canvas.js b/src/system/Canvas.js index 444484d6..51c44c6b 100644 --- a/src/system/Canvas.js +++ b/src/system/Canvas.js @@ -5,8 +5,22 @@ * @module Phaser.Canvas */ -Phaser.Canvas = { +/** +* The Canvas class handles everything related to the tag as a DOM Element, like styles, offset, aspect ratio +* +* @class Canvas +* @static +*/ +Phaser.Canvas = { + /** + * Creates the tag + * + * @method create + * @param {number} width The desired width + * @param {number} height The desired height + * @return {HTMLCanvasElement} the newly created tag + */ create: function (width, height) { width = width || 256; @@ -23,6 +37,10 @@ Phaser.Canvas = { /** * Get the DOM offset values of any given element + * @method getOffset + * @param {HTMLElement} element The targeted element that we want to retrieve the offset + * @param {Phaser.Point} [point] The point we want to take the x/y values of the offset + * @return point {Phaser.Point} A point objet with the offsetX and Y as its properties */ getOffset: function (element, point) { diff --git a/src/utils/Utils.js b/src/utils/Utils.js index 19282111..9aee2e8f 100644 --- a/src/utils/Utils.js +++ b/src/utils/Utils.js @@ -1,4 +1,15 @@ +/** +* @author Richard Davey +* @copyright 2013 Photon Storm Ltd. +* @license https://github.com/photonstorm/phaser/blob/master/license.txt MIT License +* @module Phaser.Utils +*/ +/** +* +* @class Utils +* @static +*/ Phaser.Utils = { /** @@ -6,6 +17,11 @@ Phaser.Utils = { * http://www.webtoolkit.info/ * pad = the string to pad it out with (defaults to a space) * dir = 1 (left), 2 (right), 3 (both) + * @method pad + * @param {string} str the target string + * @param {number} pad the string to pad it out with (defaults to a space) + * @param {number} len + * @param {number} [dir=3] the direction dir = 1 (left), 2 (right), 3 (both) **/ pad: function (str, len, pad, dir) { @@ -37,7 +53,11 @@ Phaser.Utils = { }, - // This is a slightly modified version of jQuery.isPlainObject + /** + * This is a slightly modified version of jQuery.isPlainObject + * @method isPlainObject + * @param {object} obj + */ isPlainObject: function (obj) { // Not plain objects: @@ -67,11 +87,20 @@ Phaser.Utils = { return true; }, + // deep, target, objects to copy to the target object // This is a slightly modified version of jQuery.extend (http://api.jquery.com/jQuery.extend/) // deep (boolean) // target (object to add to) // objects ... (objects to recurse and copy from) + + /** + * This is a slightly modified version of jQuery.extend (http://api.jquery.com/jQuery.extend/) + * @method extend + * @param {bool} [deep] If true, the merge becomes recursive (aka. deep copy). + * @param {object} target The object to add to + * @param {object} objets Objects to recurse and copy from + */ extend: function () { var options, name, src, copy, copyIsArray, clone, @@ -147,17 +176,18 @@ Phaser.Utils = { // Global functions that PIXI needs -/** + /** * Converts a hex color number to an [R, G, B] array * * @method HEXtoRGB - * @param hex {Number} + * @param {Number} hex + * @return {array} */ function HEXtoRGB(hex) { return [(hex >> 16 & 0xFF) / 255, ( hex >> 8 & 0xFF) / 255, (hex & 0xFF)/ 255]; } -/** + /** * A polyfill for Function.prototype.bind * * @method bind From 1b5c1f18fe330c90f60de0f277d977beac8565d5 Mon Sep 17 00:00:00 2001 From: Webeled Date: Thu, 19 Sep 2013 17:47:12 +0200 Subject: [PATCH 4/4] More camera examples --- examples/camera/follow styles.php | 139 ++++++++++++++++++++++++++++++ examples/camera/world sprite.php | 70 +++++++++++++++ 2 files changed, 209 insertions(+) create mode 100644 examples/camera/follow styles.php create mode 100644 examples/camera/world sprite.php diff --git a/examples/camera/follow styles.php b/examples/camera/follow styles.php new file mode 100644 index 00000000..dac30a44 --- /dev/null +++ b/examples/camera/follow styles.php @@ -0,0 +1,139 @@ + + + + + + diff --git a/examples/camera/world sprite.php b/examples/camera/world sprite.php new file mode 100644 index 00000000..56244285 --- /dev/null +++ b/examples/camera/world sprite.php @@ -0,0 +1,70 @@ + + + + + +