A 2D procedural tile framework for games.
Project description
jabutiles
A 2D procedural Tile operations library for python.
Most of the backend is pillow (PIL fork), the rest is numpy.
About the classes:
jabutiles.base.BaseImage
This is the most basic class used by jabutiles.
It is nothing more than a PIL.Image wrapped around functional style methods.
This means that each operation returns a copy with the applied change.
It is not used directly, but inherited by the other core classes.
Provides most of the Image operations: rotation, reflection, cropping, ...
jabutiles.mask.Mask(BaseImage)
This class inherits from the BaseImage.
It is used to represent a pure greyscale (L mode) mask.
Used as an alpha for a Texture or to overlay two Textures.
Fully procedural.
Adds new methods.
Has two specialized children:
jabutiles.mask.ShapeMask(Mask)
A special Mask that also defines the shape of the Mask.
It's used to govern rotation and reflection operations, as well as the final Tile shape.
Fully procedural.
Can be:
orthogonal: square (Pokemon up to GBA, Stardew Valley)isometric: diamond (Age of Empires II, Diablo II)hexagonal:.flat(?) or.point(Heroes of Might and Magic III)
jabutiles.mask.EdgeMask(ShapeMask)
A special ShapeMask that also governs interactions with its surroundings.
Partially procedural.
jabutiles.texture.Texture(BaseImage)
This class inherits from the BaseImage.
It is used to represent pure RGB visual data.
Usually generated in-code or loaded from an image file.
Adds new methods.
jabutiles.shade.Shade
A collection of parameters to apply a "shadow" onto a Texture.
The shape is controlled by a Mask.
jabutiles.layer.Layer
A combination of a Texture, a Mask and one/two Shades.
If only Texture, it's regarded as a base Texture.
If only ShapeMask, it's regarded as a Shape cutter.
If both exist, the Mask is the Texture's alpha.
jabutiles.tile.Tile
A collection of (at least one) Layers.
If only one, it MUST contain a Texture.
Usually follows this pattern:
[
Layer(Texture, None), # 1. Base Layer, the Texture is the base
Layer(Texture, Mask, Shade), # 2. Detail Layer, overlays information
... # Mask has no Shape nor Edges, is usually a pattern
Layer(Texture, EdgeMask, Shade) # 3. Edges Layer, defines how to interact with neighbours
... # Can be more than one if surrounded by different Textures
Layer(None, ShapeMask), # 4. Shape Layer, defines the final appearance
]
Exporting the resulting Image means stacking up the layers.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jabutiles-0.0.5.tar.gz.
File metadata
- Download URL: jabutiles-0.0.5.tar.gz
- Upload date:
- Size: 45.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd54a4815f9f4eb7ecff1b1eda9c9384facd273771557ae8191f853744937075
|
|
| MD5 |
409e67737dfe23c9fccff90455dcad3d
|
|
| BLAKE2b-256 |
f8ba9e6a1b6a72c90704fbdc1b050e1225663fb29716c20b5226d72fde7ca57d
|
File details
Details for the file jabutiles-0.0.5-py3-none-any.whl.
File metadata
- Download URL: jabutiles-0.0.5-py3-none-any.whl
- Upload date:
- Size: 19.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
312a9e37be9f409316b22c2e0dba35e19107c16889dfa27564321a7ce4294c50
|
|
| MD5 |
5624a3d0d64b38faf00c8372cc081a2b
|
|
| BLAKE2b-256 |
85228e7779f1556046f320c4496fd45cd64c294b123f52a2f0456f7c65f5f89c
|