Skip to content

Commit 582a742

Browse files
author
Evan
committed
filling in most of the jsdocs for GetFastValue and SpriteSheetFromAtlas
1 parent 0e401bb commit 582a742

2 files changed

Lines changed: 14 additions & 12 deletions

File tree

src/textures/parsers/SpriteSheetFromAtlas.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,23 @@ var GetFastValue = require('../../utils/object/GetFastValue');
88

99
/**
1010
* Parses a Sprite Sheet and adds the Frames to the Texture, where the Sprite Sheet is stored as a frame within an Atlas.
11-
*
11+
*
1212
* In Phaser terminology a Sprite Sheet is a texture containing different frames, but each frame is the exact
1313
* same size and cannot be trimmed or rotated.
1414
*
1515
* @function Phaser.Textures.Parsers.SpriteSheetFromAtlas
16-
* @memberOf Phaser.Textures.Parsers
16+
* @memberof Phaser.Textures.Parsers
1717
* @since 3.0.0
1818
*
1919
* @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to.
2020
* @param {Phaser.Textures.Frame} frame - The Frame that contains the Sprite Sheet.
21-
* @param {object} config - [description]
21+
* @param {object} config - An object describing how to parse the Sprite Sheet.
22+
* @param {number} config.frameWidth - Width in pixels of a single frame in the sprite sheet.
23+
* @param {number} [config.frameHeight] - Height in pixels of a single frame in the sprite sheet. Defaults to frameWidth if not provided.
24+
* @param {number} [config.startFrame=0] - [description]
25+
* @param {number} [config.endFrame=-1] - [description]
26+
* @param {number} [config.margin=0] - If the frames have been drawn with a margin, specify the amount here.
27+
* @param {number} [config.spacing=0] - If the frames have been drawn with spacing between them, specify the amount here.
2228
*
2329
* @return {Phaser.Textures.Texture} The Texture modified by this parser.
2430
*/

src/utils/object/GetFastValue.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,17 @@
44
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
55
*/
66

7-
// Source object
8-
// The key as a string, can only be 1 level deep (no periods), must exist at the top level of the source object
9-
// The default value to use if the key doesn't exist
10-
117
/**
12-
* [description]
8+
* Finds the key within the top level of the {@link source} object, or returns {@link defaultValue}
139
*
1410
* @function Phaser.Utils.Object.GetFastValue
1511
* @since 3.0.0
1612
*
17-
* @param {object} source - [description]
18-
* @param {string} key - [description]
19-
* @param {*} [defaultValue] - [description]
13+
* @param {object} source - The object to search
14+
* @param {string} key - The key for the property on source. Must exist at the top level of the source object (no periods)
15+
* @param {*} [defaultValue] - The default value to use if the key does not exist.
2016
*
21-
* @return {*} [description]
17+
* @return {*} The value if found; otherwise, defaultValue (null if none provided)
2218
*/
2319
var GetFastValue = function (source, key, defaultValue)
2420
{

0 commit comments

Comments
 (0)