Expand description
Helper functions to use the Wave Function Collapse algorithm provided by the wfc crate on tile-based maps.
You can load layer CSV files like the ones exported from Tiled, and save the result as another CSV or as a Tiled .tmx file for previewing inside the software.
As the underlying library only works on two dimensions, multiple layers are not supported.
You should start with the TilePattern struct.
Complete examples are provided in the crate’s examples folder.
Structs§
- Coord
- General purpose coordinate
- Forbid
Interface - Forbid
Nothing - Force
Border Forbid - Used to prevent wrapping on the edges in the result
- Size
- A size cannot be created which would contain un-addressable cells.
That is, the maximum size has a width and height of one greater than the maximum
i32. - Tile
Pattern - Extracts a pattern from a tilemap and lets you run Wave Function Collapse on it.
- TileSet
- WrapXY
Enums§
Traits§
Functions§
- grid_
to_ csv - Save a Grid to a CSV file.
- grid_
to_ image - Convert a Grid to a DynamicImage.
- grid_
to_ tiled - Save a Grid to a Tiled .tmx file.