bevy_tileset
Simple, configurable tilesets in Bevy using RON.
All GIFs generated with the
bevy_tileset_mapcrate
📋 Features
- Define tilesets and tiles via RON files
- Load a tileset directly as a Bevy asset
- Define Standard, Animated, Variant, and Auto tiles
📲 Installation
Add one of the following lines to your Cargo.toml.
[]
= "0.8" # For the base tile definitions
= "0.8" # For general tileset usage (includes above)
✨ Usage
Simply define your tiles and tilesets in config files:
// assets/tiles/my_tile.ron
// assets/my_tileset.ron
And load it in via a system:
use *;
use *;
Then access the generated tileset from anywhere:
Tile Types
Currently there are four main tile types:
🖼 Standard
Defines a basic tile.
// assets/tiles/my-tile.ron
🎞️ Animated
Defines an animated tile that can be generated with the GPUAnimated component from bevy_ecs_tilemap.
// assets/tiles/my-animated-tile.ron
🎲 Variant
With the
variantsfeature enabled
Defines a tile that has a set of possible variants. A variant is chosen at random when placed. These variants can either be Standard or Animated.
// assets/tiles/my-variant-tile.ron
🧠 Auto
With the
auto-tilefeature enabled
Defines a tile that automatically chooses its active tile based on its neighbors. This behavior can be controlled with rules. These sub-tiles are themselves Variant tiles.
// assets/tiles/my-auto-tile.ron
🎓 Examples
Also, be sure to check out the assets folder for how to define a tile or tileset.
🌱 Areas of Growth
There are some things this crate could do better in. Here's a list of potential areas to grow:
- Tileset
- Config files ★
- Improved Auto Tiles
- Mirror/Rotation (designate a rule to be mirrored or rotated)
- Loading
- Load configs as assets
As well as just an overall improved and cleaner API.
🎵 Important Note
These tiles are defined with the bevy_ecs_tilemap crate in mind.
Therefore, it's meant to work with an index-based tile system (where a tile's texture is defined as an index into a
texture atlas). Other solutions may need to be adapted in order to work with this crate.
🕊 Bevy Compatibility
| bevy | bevy_tileset |
|---|---|
| 0.11 | 0.8 |
| 0.10 | 0.7 |
| 0.9 | 0.6 |
| 0.8 | 0.5 |
| 0.7 | 0.4 |
| 0.6 | 0.3 |
| 0.5 | 0.2 |