Collection of different items. The items can for example be assigned to a Teemap or a Layer. You can generate new items and just put them in the appropriate place in a map, they will be recognized automatically when you save your map.
copyright: | 2010-2012 by the TML Team, see AUTHORS for more details. |
---|---|
license: | GNU GPL, see LICENSE for more details. |
Represents an envelope.
The envelopes for a map should be in the list Teemap.envelopes.
Represents an envpoint.
Envpoints are part of envelopes and should be in the envpoints list of an envelope.
Represents a group.
The groups of a map should be assigned to Teemap.groups
Adds a layer to the group.
Parameters: | layer – Layer to append. |
---|---|
Raises : | TypeError |
Represents an image.
The images for a map should be in the list Teemap.images.
Saves the image to the given path.
Parameters: | dest – Path to the image |
---|
Represents a map info object.
Should be assigned to Teemap.mapinfo.
Represents the layer data every layer has.
A layer must always be part of a Group, assign it to the Group.layers list.
Represents a quad of a quadlayer.
Represents a quadlayer.
A layer must always be part of a Group, assign it to the Group.layers list.
Parameters: |
|
---|
Handles quads while sparing memory.
Keeps track of quads as simple strings, but returns a Quad class on demand.
Note
Because QuadManager generates Quad classes on-the-fly, you need to assign new quad explicity. This will not work like you would expect:
>>> layer.quads[10].rotate('l')
Instead, you need to re-assign the quad:
>>> quad = layer.quads[10]
>>> quad.rotate('l')
>>> layer.quads[10] = quad
We are searching for a better solution, in the meanwhile, use this workaround
Parameters: |
|
---|
Represents a speedup tile of a tilelayer. Only for race modification.
Represents a tele tile of a tilelayer. Only for race modification.
Represents a tile of a tilelayer.
Coordinates of the tile in the mapres.
Returns: | (x, y) |
---|
Gives the flags of the tile.
The flags contain the rotation, hflip and vflip information.
Returns: | {‘rotation’: int, ‘vflip’: int, ‘hflip’: int} |
---|
Flip the tile in horizontal direction
Rotate the tile.
Parameters: | value (str) – Rotationdirection, can be (l)eft or (r)ight |
---|---|
Raises : | ValueError |
Flip the tile in vertical direction
Represents a tilelayer.
A layer must always be part of a Group, assign it to the Group.layers list.
Parameters: |
|
---|
Draws the the passed tilelayer onto itself.
If the given tilelayer is too big, it will be cut and the rest discarded.
Get a tile by its coordinates.
Select an area of the tilelayer.
Creates a new TileLayer of the section you are selecting. If you are selecting over the borders, it will just cut your selection to fit to the layer.
Returns: | TileLayer |
---|
Set a tile by coordinates.
Handles tiles while sparing memory.
Keeps track of tiles as simple strings, but returns a Tile class on demand.
Note
Because TileManager generates Tile classes on-the-fly, you need to assign new tiles explicity. This will not work like you would expect:
>>> layer.tiles[10].rotate('l')
Instead, you need to re-assign the tile:
>>> tile = layer.tiles[10]
>>> tile.rotate('l')
>>> layer.tiles[10] = tile
We are searching for a better solution, in the meanwhile, use this workaround
Parameters: |
|
---|