Skip to main content

A 2D procedural tile framework for games.

Project description

TODO: Improve README

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.4.tar.gz (42.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.4-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: jabutiles-0.0.4.tar.gz
  • Upload date:
  • Size: 42.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.4.tar.gz
Algorithm Hash digest
SHA256 a6159204b3d3128f596931089548967f545589a54b6c8632dc102a01eb46ba4e
MD5 e8fafc621821c55c99c1ccf8bbe0260c
BLAKE2b-256 b21f6ee928c2b05710d22462c5f67b9effde8bb1b1f3dc447bfdf37d34600f03

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jabutiles-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 19.7 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 80dfa0f5f91a8f31e3b7d5699b8e454ae6777731d7d6da68b72e98e19170f764
MD5 4de156a9245c0d940838a32317b2d725
BLAKE2b-256 eaea7b601a0ba4365e64d4d5ef2490cd9ebbbfc2af575f50ac7620f1bbc1803c

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