Skip to main content

Tile Forge

This is a package for rendering top-down maps from a provided tile set image.

Class Diagram

---
title: Class Relations
---

classDiagram
    Renderer *-- Tileset
    Renderer *-- Map
    class Tileset {
        + all_properties: dict[int, set[int]]
        + tile_size: int
        + path: str
        + load()
        + get_scaled_tiles(scale: int)
        + has_property(tile_index: int, property_id: int): bool
        + set_property(tile_index: int, property_index: int): void
        + remove_property(tile_index: int, property_index: int): void
        + toggle_property(tile_index: int, property_index: int): void
    }

    class Map {
        + width: int
        + height: int
        + layers: list[Layer]
        + set_layers(layers: list[Layer])
        + set_layer_count(count: int)
        + add_layer(layer: Layer)
        + cell_has_property(tileset: Tileset, pos: tuple[int, int], property_id: int): bool
    }

    class Renderer {
        - __map: Map
        - __tileset: Tileset
        + render_tile_size: int
        + tiles: list[Surface]
        + set_render_scale(scale: int)
        + render(surface: Surface, offset: [int, int], callback): void
    }

Usage

import pygame
from tileforge import Tileset, Map, Renderer

pygame.init()

# You need a pygame surface to render the map, so make sure to initialize pygame first
surface = pygame.Surface((640, 480))  # Create a surface to render on

# Load the tileset and map
tileset = Tileset("path/to/tileset.png", 32)
tileset.load()

# Create a map with the loaded tileset
map = Map(10, 10)  # 10x10

# Create a renderer and render the map
renderer = Renderer(tileset, map)
renderer.render(surface)

Metadata

Release files for tileforge 0.1.14

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tileforge 0.1.14
File Size Uploaded Provenance Actions
tileforge-0.1.14.tar.gz 8.1 kB Without provenance Details for tileforge-0.1.14.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tileforge 0.1.14
File Interpreter ABI Platform Actions
tileforge-0.1.14-py3-none-any.whl Python 3 none any Details for tileforge-0.1.14-py3-none-any.whl

Total release size: 15.4 kB

Release files / tileforge-0.1.14.tar.gz

Download URL tileforge-0.1.14.tar.gz
Size 8.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b89da673bb5b3a20867ca6fb2c990d22740132bd3886cfc4ffcac5dafe64f125
BLAKE2b-256 checksum
How to use checksums
40b2664e724ce9897da4d1407de33b7bea88fb09337e4fc3fab31f1df46f4e93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release files / tileforge-0.1.14-py3-none-any.whl

Download URL tileforge-0.1.14-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
28c98acabead7e4b1a37a1a3c107a0fd68837d787ebf3851436888f32e553772
BLAKE2b-256 checksum
How to use checksums
4e7b9c580b1046bb853ddb9212169f8aade41f5977cf9427b8da7b1215d8716b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Security for tileforge 0.1.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page