Class cocos.tiles.Cell

Known Subclasses:
HexCell, RectCell

Base class for cells from rect and hex maps.

Common attributes:
i, j -- index of this cell in the map position -- the above as a tuple width, height -- dimensions properties -- arbitrary properties cell -- cell from the MapLayer's cells

Properties are available through the dictionary interface, ie. if the cell has a property 'cost' then you may access it as:

cell['cost']

You may also set properties in this way and use the .get() method to supply a default value.

If the named property does not exist on the cell it will be looked up on the cell's tile.

Methods

  __init__(self, i, j, width, height, properties, tile)
  __contains__(self, key)
  __getitem__(self, key)
  __setitem__(self, key, value)
  get(self, key, default=None)
  __repr__(self)

Properties

  position

Property Details

position