Skip to main content

Small tool to write a valid textures text file for the zdoom engine, inteded to be used for automated scripts.

Project description

Zdoom-TexturesWriter

Small tool to write a valid textures text file for the zdoom engine, inteded to be used for automated scripts.

Installation

pip

You can simply use the pip command

pip install zd-textures-tool

Then you can import in your script whit:

import zd-textures-tool

Use

Here a small example, the script itself has some more examples inside of it.

import zdtwriter # zdoom-textures-writer

# Make a new texture block
wall = TextureData("WALLBRICK",type = "walltexture", optional = True, scaleY = 1.2)

# Make a path block
p = PatchData("textures/brick.png")

# Add the patch in the texture
wall.add_patch(p)

# Show on screen a texture block.
print(wall.write())

manual

all of the code is inside of zdtwriter.py in the src folder, you can get the file and manually import it in your script.

Content

The script define 2 classes, 3 functions, 1 global value and some example code.

Classes

  • PatchData
    • Contain all properties for a patch and can write a valid patch block.
  • TextureData
    • Contain all properties of a texture block, patches can be added whit add_patch and can write a valid texture block.

Methods

  • write_textures(blocks)
    • Will write a list of TextureData into a single string, basically just execute a loop and handle errors.
  • read_textures(parse)
    • Will read a string and parse into TextureData and TexturePatch, currently it work but can be improved.
    • If you want to read a file you need to use open() and read() first, this method require a string to parse, not a file path.
  • to_sprite_name(name, index, rotation)
    • Will convert a string into a valid Sprite name, can be usefull for rotation sprites and sprites that uses more than 25 frames for animations. (later i will document more)

Globals

  • compact_mode = True
    • if enabled all default properties are ignored when writing patches and textures, the output can become smaller.
    • if disabled all default properties will be written.

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zdoom-textures-tool-1.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

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

zdoom_textures_tool-1.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file zdoom-textures-tool-1.0.tar.gz.

File metadata

  • Download URL: zdoom-textures-tool-1.0.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for zdoom-textures-tool-1.0.tar.gz
Algorithm Hash digest
SHA256 1b7b2db0f9dc1774299c89dafe48d9ee59810bd1a508c385a726e392bc96b0f1
MD5 4123ac0ab1c552d675cfca6f5c5be06c
BLAKE2b-256 ab5b98bfabcd78cc0c5bbeeb56fc013e76cd20684f8decede0a5c1822317b082

See more details on using hashes here.

File details

Details for the file zdoom_textures_tool-1.0-py3-none-any.whl.

File metadata

  • Download URL: zdoom_textures_tool-1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for zdoom_textures_tool-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5d0cb658ac89fe9d679cc1cbd2914561a9e216e9b4f12d1f727f8979af5b6b2d
MD5 ff7b90a85ae16ad87712d4a390ae3799
BLAKE2b-256 b006242e9179a7d772e862bfaf1caf55c289eabbf056936971ae9b561bcc510f

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