TileGrid
TileGrid
Kind: global class
- TileGrid
- new TileGrid(width, height)
- .tiles :
List.<Rectangle> - .capacity :
Vector1 - .computeTotalTileArea() ⇒
number - .getOverlappingTiles(rect) ⇒
Array.<Rectangle> - .getOverlappingTilesRaw(result, x, y, w, h) ⇒
number - .contains(tile) ⇒
boolean - .findEmptySlotFor(result, w, h) ⇒
boolean - .computePossibleTilePositions(tileWidth, tileHeight, visitor)
- .add(tile)
- .addAll(tiles)
new TileGrid(width, height)
| Param | Type |
|---|---|
| width | number |
| height | number |
tileGrid.tiles : List.<Rectangle>
Kind: instance property of TileGrid
tileGrid.capacity : Vector1
Kind: instance property of TileGrid
tileGrid.computeTotalTileArea() ⇒ number
Kind: instance method of TileGrid
tileGrid.getOverlappingTiles(rect) ⇒ Array.<Rectangle>
Kind: instance method of TileGrid
| Param | Type |
|---|---|
| rect | Rectangle |
tileGrid.getOverlappingTilesRaw(result, x, y, w, h) ⇒ number
Kind: instance method of TileGrid
Returns: number - number of overlapping tiles found
| Param | Type | Description |
|---|---|---|
| result | Array.<Rectangle> | tiles will be added here |
| x | number | |
| y | number | |
| w | number | |
| h | number |
tileGrid.contains(tile) ⇒ boolean
Kind: instance method of TileGrid
| Param | Type |
|---|---|
| tile | Rectangle |
tileGrid.findEmptySlotFor(result, w, h) ⇒ boolean
Look up a slot for a rectangular tile of a given size
Kind: instance method of TileGrid
| Param | Type |
|---|---|
| result | Vector2 |
| w | number |
| h | number |
tileGrid.computePossibleTilePositions(tileWidth, tileHeight, visitor)
Kind: instance method of TileGrid
| Param | Type |
|---|---|
| tileWidth | number |
| tileHeight | number |
| visitor | function |
tileGrid.add(tile)
Kind: instance method of TileGrid
| Param | Type |
|---|---|
| tile | Rectangle |
tileGrid.addAll(tiles)
Kind: instance method of TileGrid
| Param | Type |
|---|---|
| tiles | Array.<Rectangle> |