png-to-twmap

Crates.iopng-to-twmap
lib.rspng-to-twmap
version0.4.2
sourcesrc
created_at2024-04-20 01:01:17.34818
updated_at2024-04-26 16:08:52.478722
descriptionCreates a teeworlds map from a png
homepage
repositoryhttps://github.com/hardliner66/png-to-twmap
max_upload_size
id1214263
size53,247
Steve Biedermann (hardliner66)

documentation

README

png-to-twmap

Takes a png and builds a teeworlds map out of it.

Usage

Create a png and call the converter, passing the path as an argument. It should also work to drag & drop the file onto the exe, if you're on windows.

Default Colors

Name HTML-Color preview
Hookable #B97A57 brown
Unhookable #FF7F27 orange
Air #000000 black
Freeze #C3C3C3 light grey
Spawn #3F48CC indigo
Start #FFC90E gold/yellow
Finish #22B14C green

Configuration

To configure which color gets mapped to which entity id, first export the default config:

png-to-twmap --print-default-mappings > config.rsn

Then you edit the config file and add a mapping from an RGBA color to an entity id.

There are a few pre-defined entity types that are named:

  • Empty
  • Unookable
  • Hookable
  • Freeze
  • Spawn
  • Start
  • Finish

If you need some other entity, you can use Custom with the appropriate id. For instance:

Custom(123)
Commit count: 16

cargo fmt