a2d.TileGrid - Armen138/a2d GitHub Wiki
extends a2d.Node
Defined in tilegrid.js
|
a2d.TileGrid(data) a2d.TileGridNode
|
| **[fireEvent](#fireEvent)** (eventName, eventObject) Hijack the fireEvent method to add a little tile-related information to each click event | |
| _number_ | **[getHeight](#getHeight)** |
| **[getMini](#getMini)** (miniSize) render an image of this tilegrid in the given size, presumably to use as a base for a minimap. | |
| *a2d.Position* | **[getTile](#getTile)** (pos) |
| _Array_ | **[getTiles](#getTiles)** |
| _number_ | **[getWidth](#getWidth)** |
| *a2d.Position* | **[toPix](#toPix)** (pos) |
| _object, a2d.Position, a2d.Position_ | **[visibleArea](#visibleArea)** Get the visible area of the map |
a2d.TileGrid(data)
a2d.TileGridNode
{object} data
fireEvent (eventName, eventObject)
Hijack the fireEvent method to add a little tile-related information to each click event
eventName
eventObject
{number}
grid height
--
getMini (miniSize)
render an image of this tilegrid in the given size,
presumably to use as a base for a minimap.
{a2d.Dimension} miniSize
drawable a2d.SceneNode containing a static image of the level in requested size. warning: using sizes that result in fractured scales may leave some lines blank between tiles.
-- {a2d.Position} getTile (pos)
{a2d.Position} pos
{a2d.Position}
tile position from pixel position
{Array}
array of tiles
{number}
grid width
-- {a2d.Position} toPix (pos)
{a2d.Position} pos
{a2d.Position}
pixel position from tile position
--
{object, a2d.Position, a2d.Position} visibleArea
Get the visible area of the map
{object}
o
{a2d.Position}
o.from coordinates of the top left visible tile
{a2d.Position}
o.to coordinates of the bottom right tile