mirror of
https://github.com/photonstorm/phaser
synced 2024-11-16 01:38:23 +00:00
jsdoc fixes.
This commit is contained in:
parent
0e73a6428a
commit
c4b81ff6ea
9 changed files with 81 additions and 20 deletions
|
@ -169,7 +169,7 @@ Phaser.Frame.prototype = {
|
|||
* Clones this Frame into a new Phaser.Frame object and returns it.
|
||||
* Note that all properties are cloned, including the name, index and UUID.
|
||||
*
|
||||
* @method clone
|
||||
* @method Phaser.Frame#clone
|
||||
* @return {Phaser.Frame} An exact copy of this Frame object.
|
||||
*/
|
||||
clone: function () {
|
||||
|
|
|
@ -108,7 +108,7 @@ Phaser.FrameData.prototype = {
|
|||
/**
|
||||
* Makes a copy of this FrameData including copies (not references) to all of the Frames it contains.
|
||||
*
|
||||
* @method clone
|
||||
* @method Phaser.FrameData#clone
|
||||
* @return {Phaser.FrameData} A clone of this object, including clones of the Frame objects it contains.
|
||||
*/
|
||||
clone: function () {
|
||||
|
|
|
@ -105,6 +105,7 @@ Phaser.Camera = function (game, id, x, y, width, height) {
|
|||
|
||||
/**
|
||||
* @property {Phaser.Point} _targetPosition - Internal point used to calculate target position
|
||||
* @private
|
||||
*/
|
||||
this._targetPosition = new Phaser.Point();
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ Phaser.FlexGrid.prototype = {
|
|||
/**
|
||||
* Sets the core game size. This resets the w/h parameters and bounds.
|
||||
*
|
||||
* @method setSize
|
||||
* @method Phaser.FlexGrid#setSize
|
||||
* @param {number} width - The new dimensions.
|
||||
* @param {number} height - The new dimensions.
|
||||
*/
|
||||
|
@ -104,7 +104,7 @@ Phaser.FlexGrid.prototype = {
|
|||
/**
|
||||
* A custom layer is centered on the game and maintains its aspect ratio as it scales up and down.
|
||||
*
|
||||
* @method createCustomLayer
|
||||
* @method Phaser.FlexGrid#createCustomLayer
|
||||
* @param {number} width - Width of this layer in pixels.
|
||||
* @param {number} height - Height of this layer in pixels.
|
||||
* @param {array} [children] - An array of children that are used to populate the FlexLayer.
|
||||
|
@ -141,7 +141,7 @@ Phaser.FlexGrid.prototype = {
|
|||
/**
|
||||
* A fluid layer is centered on the game and maintains its aspect ratio as it scales up and down.
|
||||
*
|
||||
* @method createFluidLayer
|
||||
* @method Phaser.FlexGrid#createFluidLayer
|
||||
* @param {array} [children] - An array of children that are used to populate the FlexLayer.
|
||||
* @return {Phaser.FlexLayer} The Layer object.
|
||||
*/
|
||||
|
@ -170,7 +170,7 @@ Phaser.FlexGrid.prototype = {
|
|||
/**
|
||||
* A full layer is placed at 0,0 and extends to the full size of the game. Children are scaled according to the fluid ratios.
|
||||
*
|
||||
* @method createFullLayer
|
||||
* @method Phaser.FlexGrid#createFullLayer
|
||||
* @param {array} [children] - An array of children that are used to populate the FlexLayer.
|
||||
* @return {Phaser.FlexLayer} The Layer object.
|
||||
*/
|
||||
|
@ -194,7 +194,7 @@ Phaser.FlexGrid.prototype = {
|
|||
/**
|
||||
* A fixed layer is centered on the game and is the size of the required dimensions and is never scaled.
|
||||
*
|
||||
* @method createFixedLayer
|
||||
* @method Phaser.FlexGrid#createFixedLayer
|
||||
* @param {array} [children] - An array of children that are used to populate the FlexLayer.
|
||||
* @return {Phaser.FlexLayer} The Layer object.
|
||||
*/
|
||||
|
@ -218,7 +218,7 @@ Phaser.FlexGrid.prototype = {
|
|||
/**
|
||||
* Resets the layer children references
|
||||
*
|
||||
* @method reset
|
||||
* @method Phaser.FlexGrid#reset
|
||||
*/
|
||||
reset: function () {
|
||||
|
||||
|
@ -240,7 +240,7 @@ Phaser.FlexGrid.prototype = {
|
|||
/**
|
||||
* Called when the game container changes dimensions.
|
||||
*
|
||||
* @method onResize
|
||||
* @method Phaser.FlexGrid#onResize
|
||||
* @param {number} width - The new width of the game container.
|
||||
* @param {number} height - The new height of the game container.
|
||||
*/
|
||||
|
@ -256,7 +256,7 @@ Phaser.FlexGrid.prototype = {
|
|||
/**
|
||||
* Updates all internal vars such as the bounds and scale values.
|
||||
*
|
||||
* @method refresh
|
||||
* @method Phaser.FlexGrid#refresh
|
||||
*/
|
||||
refresh: function () {
|
||||
|
||||
|
@ -281,6 +281,12 @@ Phaser.FlexGrid.prototype = {
|
|||
|
||||
},
|
||||
|
||||
/**
|
||||
* Fits a sprites width to the bounds.
|
||||
*
|
||||
* @method Phaser.FlexGrid#fitSprite
|
||||
* @param {Phaser.Sprite} sprite - The Sprite to fit.
|
||||
*/
|
||||
fitSprite: function (sprite) {
|
||||
|
||||
this.manager.scaleSprite(sprite);
|
||||
|
@ -293,7 +299,7 @@ Phaser.FlexGrid.prototype = {
|
|||
/**
|
||||
* Call in the render function to output the bounds rects.
|
||||
*
|
||||
* @method debug
|
||||
* @method Phaser.FlexGrid#debug
|
||||
*/
|
||||
debug: function () {
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* @class Phaser.FlexLayer
|
||||
* @extends Phaser.Group
|
||||
* @constructor
|
||||
* @param {Phaser.ScaleManager} manager - The ScaleManager.
|
||||
* @param {Phaser.FlexGrid} manager - The FlexGrid that owns this FlexLayer.
|
||||
* @param {Phaser.Point} position - A reference to the Point object used for positioning.
|
||||
* @param {Phaser.Rectangle} bounds - A reference to the Rectangle used for the layer bounds.
|
||||
* @param {Phaser.Point} scale - A reference to the Point object used for layer scaling.
|
||||
|
@ -40,17 +40,49 @@ Phaser.FlexLayer = function (manager, position, bounds, scale) {
|
|||
*/
|
||||
this.persist = false;
|
||||
|
||||
// Bound to the grid
|
||||
/**
|
||||
* @property {Phaser.Point} position
|
||||
*/
|
||||
this.position = position;
|
||||
|
||||
/**
|
||||
* @property {Phaser.Rectangle} bounds
|
||||
*/
|
||||
this.bounds = bounds;
|
||||
|
||||
/**
|
||||
* @property {Phaser.Point} scale
|
||||
*/
|
||||
this.scale = scale;
|
||||
|
||||
/**
|
||||
* @property {Phaser.Point} topLeft
|
||||
*/
|
||||
this.topLeft = bounds.topLeft;
|
||||
|
||||
/**
|
||||
* @property {Phaser.Point} topMiddle
|
||||
*/
|
||||
this.topMiddle = new Phaser.Point(bounds.halfWidth, 0);
|
||||
|
||||
/**
|
||||
* @property {Phaser.Point} topRight
|
||||
*/
|
||||
this.topRight = bounds.topRight;
|
||||
|
||||
/**
|
||||
* @property {Phaser.Point} bottomLeft
|
||||
*/
|
||||
this.bottomLeft = bounds.bottomLeft;
|
||||
|
||||
/**
|
||||
* @property {Phaser.Point} bottomMiddle
|
||||
*/
|
||||
this.bottomMiddle = new Phaser.Point(bounds.halfWidth, bounds.bottom);
|
||||
|
||||
/**
|
||||
* @property {Phaser.Point} bottomRight
|
||||
*/
|
||||
this.bottomRight = bounds.bottomRight;
|
||||
|
||||
};
|
||||
|
@ -58,9 +90,19 @@ Phaser.FlexLayer = function (manager, position, bounds, scale) {
|
|||
Phaser.FlexLayer.prototype = Object.create(Phaser.Group.prototype);
|
||||
Phaser.FlexLayer.prototype.constructor = Phaser.FlexLayer;
|
||||
|
||||
/**
|
||||
* Resize.
|
||||
*
|
||||
* @method Phaser.FlexLayer#resize
|
||||
*/
|
||||
Phaser.FlexLayer.prototype.resize = function () {
|
||||
};
|
||||
|
||||
/**
|
||||
* Debug.
|
||||
*
|
||||
* @method Phaser.FlexLayer#debug
|
||||
*/
|
||||
Phaser.FlexLayer.prototype.debug = function () {
|
||||
|
||||
this.game.debug.text(this.bounds.width + ' x ' + this.bounds.height, this.bounds.x + 4, this.bounds.y + 16);
|
||||
|
@ -70,5 +112,4 @@ Phaser.FlexLayer.prototype.debug = function () {
|
|||
this.game.debug.geom(this.topMiddle, 'rgba(255,255,255,0.9');
|
||||
this.game.debug.geom(this.topRight, 'rgba(255,255,255,0.9');
|
||||
|
||||
|
||||
};
|
||||
|
|
|
@ -127,7 +127,7 @@ Phaser.Events.prototype = {
|
|||
/**
|
||||
* Removes all events.
|
||||
*
|
||||
* @method destroy
|
||||
* @method Phaser.Events#destroy
|
||||
*/
|
||||
destroy: function () {
|
||||
|
||||
|
|
|
@ -466,7 +466,7 @@ Phaser.Gamepad.prototype = {
|
|||
/**
|
||||
* Destroys this object and the associated event listeners.
|
||||
*
|
||||
* @method destroy
|
||||
* @method Phaser.Gamepad#destroy
|
||||
*/
|
||||
destroy: function () {
|
||||
|
||||
|
|
|
@ -601,19 +601,28 @@ Object.defineProperty(Phaser.Mouse.prototype, "disabled", {
|
|||
*
|
||||
* See https://developer.mozilla.org/en-US/docs/Web/Events/mousewheel for choosing a scale and delta mode.
|
||||
*
|
||||
* @class Phaser.Mouse~WheelEventProxy
|
||||
* @method Phaser.Mouse#WheelEventProxy
|
||||
* @private
|
||||
* @param {number} scaleFactor - Scale factor as applied to wheelDelta/wheelDeltaX or details.
|
||||
* @param {integer} deltaMode - The reported delta mode.
|
||||
*/
|
||||
function WheelEventProxy (scaleFactor, deltaMode) {
|
||||
|
||||
/**
|
||||
* @property {number} _scaleFactor - Scale factor as applied to wheelDelta/wheelDeltaX or details.
|
||||
* @private
|
||||
*/
|
||||
this._scaleFactor = scaleFactor;
|
||||
|
||||
/**
|
||||
* @property {number} _deltaMode - The reported delta mode.
|
||||
* @private
|
||||
*/
|
||||
this._deltaMode = deltaMode;
|
||||
|
||||
/**
|
||||
* The original event _currently_ being proxied; the getters will follow suit.
|
||||
* @property {any} originalEvent - The original event _currently_ being proxied; the getters will follow suit.
|
||||
* @private
|
||||
*/
|
||||
this.originalEvent = null;
|
||||
}
|
||||
|
@ -627,12 +636,16 @@ WheelEventProxy.prototype.bindEvent = function (event) {
|
|||
if (!WheelEventProxy._stubsGenerated && event)
|
||||
{
|
||||
var makeBinder = function (name) {
|
||||
|
||||
return function () {
|
||||
var v = this.originalEvent[name];
|
||||
return typeof v !== 'function' ? v : v.bind(this.originalEvent);
|
||||
};
|
||||
|
||||
};
|
||||
for (var prop in event) {
|
||||
|
||||
for (var prop in event)
|
||||
{
|
||||
if (!(prop in WheelEventProxy.prototype))
|
||||
{
|
||||
Object.defineProperty(WheelEventProxy.prototype, prop, {
|
||||
|
|
|
@ -297,7 +297,7 @@ Phaser.SinglePad.prototype = {
|
|||
/**
|
||||
* Destroys this object and associated callback references.
|
||||
*
|
||||
* @method destroy
|
||||
* @method Phaser.SinglePad#destroy
|
||||
*/
|
||||
destroy: function () {
|
||||
|
||||
|
|
Loading…
Reference in a new issue