Trees | Indices | Toggle frames |
---|
RegularTesselationMap --+ | RectMap
Rectangular map.
Cells are stored in column-major order with y increasing up, allowing [i][j] addressing:
+---+---+---+ | d | e | f | +---+---+---+ | a | b | c | +---+---+---+
Thus cells = [['a', 'd'], ['b', 'e'], ['c', 'f']]
(and thus the cell at (0,0) is 'a' and (1, 1) is 'd')
__init__(self, id, tw, th, cells, origin=None, properties=None) | |
get_in_region(self,
x1,
y1,
x2,
y2)
Return cells (in [column][row]) that are within the map-space
pixel bounds specified by the bottom-left (x1, y1) and top-right
(x2, y2) corners.
|
|
get_at_pixel(self,
x,
y)
Return Cell at pixel px=(x,y) on the map.
|
|
get_neighbor(self,
cell,
direction)
Get the neighbor Cell in the given direction (dx, dy) which
is one of self.UP, self.DOWN, self.LEFT or self.RIGHT.
|
|
get_neighbors(self,
cell,
diagonals=False)
Get all cells touching the sides of the nominated cell.
|
|
get_cell(self,
i,
j)
Return Cell at cell pos=(i, j).
(Inherited from cocos.tiles.RegularTesselationMap)
|
UP =
|
|
DOWN =
|
|
LEFT =
|
|
RIGHT =
|
Return cells (in [column][row]) that are within the map-space pixel bounds specified by the bottom-left (x1, y1) and top-right (x2, y2) corners.
Return a list of Cell instances.
Return Cell at pixel px=(x,y) on the map.
The pixel coordinate passed in is in the map's coordinate space, unmodified by screen, layer or view transformations.
Return None if out of bounds.
Get the neighbor Cell in the given direction (dx, dy) which is one of self.UP, self.DOWN, self.LEFT or self.RIGHT.
Returns None if out of bounds.
Get all cells touching the sides of the nominated cell.
If "diagonals" is True then return the cells touching the corners of this cell too.
Return a dict with the directions (self.UP, self.DOWN, etc) as keys and neighbor cells as values.
Trees | Indices | Toggle frames |
---|
Generated by Epydoc 3.0beta1 on Wed Jul 07 22:46:54 2010 | http://epydoc.sourceforge.net |