Metadata-Version: 2.4
Name: tileforge
Version: 0.1.6
Summary: A pygame rendering engine for top-down tile sets.
Author-email: Joshua Hegedus <josh.hegedus@outlook.com>
License: MIT License
        
        Copyright (c) 2026-present Joshua Hegedus <josh.hegedus@outlook.com>
        
        Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
        associated documentation files (the "Software"), to deal in the Software without restriction, including
        without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
        following conditions:
        
        The above copyright notice and this permission notice shall be included in all copies or substantial
        portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
        LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
        EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
        IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
        USE OR OTHER DEALINGS IN THE SOFTWARE.
        
Project-URL: Homepage, https://github.com/lsc-jh/tileforge
Project-URL: Repository, https://github.com/lsc-jh/tileforge
Keywords: rendering,engine,tile set,top-down
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pygame-ce
Dynamic: license-file

# Tile Forge

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

## Class Diagram

```mermaid
---
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

```python
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)
```
