Module cocos.tiles

Tile map management and rendering.

This module provides an API for loading, saving and rendering a map constructed of image tiles.

Classes

  ScrollableLayer
  ScrollingManager
  ResourceError
  TilesPropertyWithoutName
  TilesPropertyWithoutValue
  Resource
Load some tile mapping resources from an XML file.
  Tile
Tiles hold an image and some optional properties.
  TileSet
Contains a set of Tile objects referenced by some id.
  MapLayer
Base class for Maps.
  RegularTesselationMap
A regularly tesselated map that allows access to its cells by index (i, j).
  RectMap
Rectangular map.
  RectMapLayer
A renderable, scrollable rect map.
  RectMapCollider
This class implements collisions between a moving rect object and a tilemap.
  Cell
Base class for cells from rect and hex maps.
  RectCell
A rectangular cell from a MapLayer.
  HexMap
MapLayer with flat-top, regular hexagonal cells.
  HexMapLayer
A renderable, scrollable hex map.
  HexCell
A flat-top, regular hexagon cell from a HexMap.

Functions

  load(filename)
Load resource(s) defined in the indicated XML file.
  image_factory(resource, tag)
  imageatlas_factory(resource, tag)
  tileset_factory(resource, tag)
  rectmap_factory(resource, tag)
  hexmap_factory(resource, tag)
  hex_width(height)
Determine a regular hexagon's width given its height.

Variables

  __package__ = 'cocos'

Function Details

image_factory

image_factory(resource, tag)
Decorators:
  • @Resource.register_factory('image')

imageatlas_factory

imageatlas_factory(resource, tag)
Decorators:
  • @Resource.register_factory('imageatlas')

tileset_factory

tileset_factory(resource, tag)
Decorators:
  • @Resource.register_factory('tileset')

rectmap_factory

rectmap_factory(resource, tag)
Decorators:
  • @Resource.register_factory('rectmap')

hexmap_factory

hexmap_factory(resource, tag)
Decorators:
  • @Resource.register_factory('hexmap')