Skip to main content

A pure-python library to parse Clickteam TileMap files.

Project description

cttilemap

A pure-python library to parse Clickteam TileMap files.


How to use

from cttilemap import TileMap, Tile

# Load from a file
with open("tilemap.l", "rb") as f:
    tmap = TileMap.load(f)

# Get a tile and its data
# Accessing the tile at x=3, y=5

layer = tmap.layers[0]
print(layer[3, 5])
for sublayer in layer.sublayers:
    print(f"- {sublayer[3, 5]}")

# Set a tile and its data
layer[3, 5] = Tile.by_id(0xBEEF)
layer.sublayers[0][3, 5] = b'\xFF'

tmap.layers[0] = layer

# Save to a file
with open("tilemap.l", "wb+") as f:
    tmap.dump(f)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cttilemap-1.0.0.tar.gz (7.3 kB view hashes)

Uploaded Source

Built Distribution

cttilemap-1.0.0-py3-none-any.whl (7.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page