Skip to content

Commit 09224b7

Browse files
committed
Tilemap: adding jsdocs
1 parent 1db68df commit 09224b7

4 files changed

Lines changed: 38 additions & 3 deletions

File tree

v3/src/gameobjects/tilemap/components/CalculateFacesWithin.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
var GetTileAt = require('./GetTileAt');
22
var GetTilesWithin = require('./GetTilesWithin');
33

4+
/**
5+
* Calculates interesting faces within the rectangular area specified (in tile coordinates).
6+
* Interesting faces are used internally for optimizing collisions against tiles. This method is
7+
* mostly used internally.
8+
*
9+
* @param {number} [tileX=0] - [description]
10+
* @param {number} [tileY=0] - [description]
11+
* @param {number} [width=max width based on tileX] - [description]
12+
* @param {number} [height=max height based on tileY] - [description]
13+
* @param {LayerData} layer - [description]
14+
*/
415
var CalculateFacesWithin = function (tileX, tileY, width, height, layer)
516
{
617
var above = null;

v3/src/gameobjects/tilemap/components/Copy.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
11
var GetTilesWithin = require('./GetTilesWithin');
22
var CalculateFacesWithin = require('./CalculateFacesWithin');
33

4-
// Copies indices, not other properties. Does not modify collisions.
4+
/**
5+
* Copies the tiles in the source rectangular area to a new destination (all specified in tile
6+
* coordinates). This copies all tile properties & recalculates interesting tile faces in the
7+
* destination region.
8+
*
9+
* @param {number} srcTileX - [description]
10+
* @param {number} srcTileY - [description]
11+
* @param {number} width - [description]
12+
* @param {number} height - [description]
13+
* @param {number} destTileX - [description]
14+
* @param {number} destTileY - [description]
15+
* @param {number} destTileY - [description]
16+
* @param {boolean} [recalculateFaces=true] - [description]
17+
* @param {LayerData} layer - [description]
18+
*/
19+
520
var Copy = function (srcTileX, srcTileY, width, height, destTileX, destTileY, recalculateFaces, layer)
621
{
722
if (srcTileX < 0) { srcTileX = 0; }

v3/src/gameobjects/tilemap/components/CullTiles.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
/**
2+
* Returns the tiles in the given layer that are within the camera's viewport. This is used
3+
* internally.
4+
*
5+
* @param {LayerData} layer - [description]
6+
* @param {Camera} camera - [description]
7+
* @param {array} [outputArray] - [description]
8+
* @returns {array}
9+
*/
110
var CullTiles = function (layer, camera, outputArray)
211
{
312
if (outputArray === undefined) { outputArray = []; }

v3/src/gameobjects/tilemap/components/GetTilesWithinShape.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ var TriangleToRectangle = function (triangle, rect)
1414
};
1515

1616
// Circle, Line, Rect, Triangle in world coordinates.
17-
// Notes: circle is not working yet - see CircleToRectangle in geom. Could possibly be optimized
18-
// by copying the shape and shifting it into tilemapLayer coordinates instead of shifting the tiles.
17+
// Note: Could possibly be optimized by copying the shape and shifting it into tilemapLayer
18+
// coordinates instead of shifting the tiles.
1919
var GetTilesWithinShape = function (shape, filteringOptions, camera, layer)
2020
{
2121
if (shape === undefined) { return []; }

0 commit comments

Comments
 (0)