mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 13:43:26 +00:00
filling in most of the jsdocs for GetFastValue and SpriteSheetFromAtlas
This commit is contained in:
parent
0e401bb6fe
commit
582a742373
2 changed files with 14 additions and 12 deletions
|
@ -13,12 +13,18 @@ var GetFastValue = require('../../utils/object/GetFastValue');
|
|||
* same size and cannot be trimmed or rotated.
|
||||
*
|
||||
* @function Phaser.Textures.Parsers.SpriteSheetFromAtlas
|
||||
* @memberOf Phaser.Textures.Parsers
|
||||
* @memberof Phaser.Textures.Parsers
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to.
|
||||
* @param {Phaser.Textures.Frame} frame - The Frame that contains the Sprite Sheet.
|
||||
* @param {object} config - [description]
|
||||
* @param {object} config - An object describing how to parse the Sprite Sheet.
|
||||
* @param {number} config.frameWidth - Width in pixels of a single frame in the sprite sheet.
|
||||
* @param {number} [config.frameHeight] - Height in pixels of a single frame in the sprite sheet. Defaults to frameWidth if not provided.
|
||||
* @param {number} [config.startFrame=0] - [description]
|
||||
* @param {number} [config.endFrame=-1] - [description]
|
||||
* @param {number} [config.margin=0] - If the frames have been drawn with a margin, specify the amount here.
|
||||
* @param {number} [config.spacing=0] - If the frames have been drawn with spacing between them, specify the amount here.
|
||||
*
|
||||
* @return {Phaser.Textures.Texture} The Texture modified by this parser.
|
||||
*/
|
||||
|
|
|
@ -4,21 +4,17 @@
|
|||
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
||||
*/
|
||||
|
||||
// Source object
|
||||
// The key as a string, can only be 1 level deep (no periods), must exist at the top level of the source object
|
||||
// The default value to use if the key doesn't exist
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Finds the key within the top level of the {@link source} object, or returns {@link defaultValue}
|
||||
*
|
||||
* @function Phaser.Utils.Object.GetFastValue
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {object} source - [description]
|
||||
* @param {string} key - [description]
|
||||
* @param {*} [defaultValue] - [description]
|
||||
* @param {object} source - The object to search
|
||||
* @param {string} key - The key for the property on source. Must exist at the top level of the source object (no periods)
|
||||
* @param {*} [defaultValue] - The default value to use if the key does not exist.
|
||||
*
|
||||
* @return {*} [description]
|
||||
* @return {*} The value if found; otherwise, defaultValue (null if none provided)
|
||||
*/
|
||||
var GetFastValue = function (source, key, defaultValue)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue