Skip to main content

A 2D procedural tile framework for games.

Project description

jabutiles

A 2D Tile 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 of the class with the change.

It is not used directly, but inherited by the other core classes.
Provides most of the Image operations: rotation, mirroring, cropping, ...


jabutiles.mask.Mask (BaseImage)

This class inherits from the BaseImage.

It is used to represent a pure L mask.
Used as an alpha for a Texture or to overlay two Textures.

Can have additional components:

jabutiles.shape.Shape

A class that defines what is the purpose of the Mask.

It's used to govern rotation and reflection operations.

Can be:

  • orthogonal: square (GB/GBC/GBA Pokemon, Stardew Valley)
  • isometric: diamond (Age of Empires II, Diablo II)
  • hexagonal: both flat (?) and point (Heroes of Might and Magic III)

jabutiles.edges.Edges

A class that governs how the Mask interacts with surrounding Masks.

Adds new methods:

  • invert: Inverts the grayscale values (0 <-> 255)

jabutiles.texture.Texture (BaseImage)

This class inherits from the BaseImage.

It is used to represent pure RGB(A) visual data, such as a Texture.
Usually generated in-code or loaded from an image file.

Adds new methods:


jabutiles.layer.Layer

A combination of a Texture and/or a Mask.
Must have at least one of them present.

If both exist, the Mask is the Texture's alpha.
If only Texture, it's regarded as a base Texture.
If only Mask, it's regarded as a Shape cutter.


jabutiles.tile.Tile

A collection of Layers (at least one).
If only one layer, MUST contain a Texture.

Usually follows this pattern:

[
  (Texture, None),        # 1. Base Layer, the Texture is the base
  (Texture, Mask),        # 2. Detail Layer, overlays information
  ...                     # Mask has no Shape nor Edges, is usually a pattern
  (Texture, Mask(Edges))  # 3. Edges Layer, defines how to interact with neighbours
  ...                     # Can be more than one if surrounded by different Textures
  (None,    Mask(Shape)), # 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

jabutiles-0.0.1.tar.gz (53.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jabutiles-0.0.1-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

Details for the file jabutiles-0.0.1.tar.gz.

File metadata

  • Download URL: jabutiles-0.0.1.tar.gz
  • Upload date:
  • Size: 53.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for jabutiles-0.0.1.tar.gz
Algorithm Hash digest
SHA256 0ab6480ee13cbe9ea46891688b5a3d26b650bc9f84d7ab418352fa532b4ba517
MD5 b10d872cbe4ecba7bf63ee5b409878ab
BLAKE2b-256 e5a17f0cc4f4bbee8c3303a89ea3e7ba8fc59ff33bc9fe91953b2d85f743dae2

See more details on using hashes here.

File details

Details for the file jabutiles-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: jabutiles-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 19.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for jabutiles-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 32a6955ce34c1907fa1d08511b122dad80f74ee5b727381b2cb6b282a98b7b74
MD5 aa46d82e785416291bcfac0922a93961
BLAKE2b-256 a4eb8abd59a4d6f376d0b3774d45ccf4912601d680c85c03f58efa1f2437178a

See more details on using hashes here.

Supported by

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