Skip to main content

TileGrid

TileGrid

Kind: global class

new TileGrid(width, height)

ParamType
widthnumber
heightnumber

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

ParamType
rectRectangle

tileGrid.getOverlappingTilesRaw(result, x, y, w, h) ⇒ number

Kind: instance method of TileGrid
Returns: number - number of overlapping tiles found

ParamTypeDescription
resultArray.<Rectangle>tiles will be added here
xnumber
ynumber
wnumber
hnumber

tileGrid.contains(tile) ⇒ boolean

Kind: instance method of TileGrid

ParamType
tileRectangle

tileGrid.findEmptySlotFor(result, w, h) ⇒ boolean

Look up a slot for a rectangular tile of a given size

Kind: instance method of TileGrid

ParamType
resultVector2
wnumber
hnumber

tileGrid.computePossibleTilePositions(tileWidth, tileHeight, visitor)

Kind: instance method of TileGrid

ParamType
tileWidthnumber
tileHeightnumber
visitorfunction

tileGrid.add(tile)

Kind: instance method of TileGrid

ParamType
tileRectangle

tileGrid.addAll(tiles)

Kind: instance method of TileGrid

ParamType
tilesArray.<Rectangle>