Create tilemaps in seconds!
This repository contains few projects that together make a fully functional solution for generating tilemaps alongside integration to the Bevy game engine.
A Bevy plugin with support for the rpack.json
atlases.
More info available at crates/bevy_rpack.
Repository contains example how to use plugin in Bevy.
Command line interface for generating tilemaps.
Build rpack tilemaps with ease
Usage: rpack_cli <COMMAND>
Commands:
generate Generates a tilemap
config-create Creates a tilemap generation config
generate-from-config Generates a tilemap from config
help Print this message or the help of the given subcommand(s)
Options:
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
Available at crates/rpack_cli.
Only with Cargo (Rust package manager) at the moment:
cargo install rpack_cli
A both desktop and web frontend for generating tilemaps. Just drag and drop images into the program and generate tilemaps.
To open it in browser click one of the icons below:
Available at crates/rpack_egui.
rpack tools provides and work with two json based files.
Tilemaps are using .rpack.json
extension.
Fields:
size
: two element array- width and height of the tilemapfilename
: string- path to the atlas image file, relative to the config fileframes
: array- contain info about each frame in tilemap, containskey
string field andframe
field that is made up from fields:h
- image heightw
- image widthx
- x start pos of the image in the tilemapy
- y start pos of the image in the tilemap
Example:
{
"filename": "tilemap.png",
"frames": [
{
"frame": {
"h": 42,
"w": 42,
"x": 418,
"y": 66
},
"key": "tiles/ship/spaceBuilding_001"
},
{
"frame": {
"h": 44,
"w": 34,
"x": 2,
"y": 2
},
"key": "tiles/agents/spaceAstronauts_004"
},
],
"size": [
512,
512
]
}
Config files are using .rpack_gen.json
extension.
Fields:
output_path
: string- path relative to the config, without extension, this is where tilemap image and.rpack.json
config file are going to be savedasset_patterns
: array of strings- search patterns for images to be included, relative paths to the configformat
: optional(defaults toPng
), format of the tilemap image, currently supported values:Png
,Dds
size
: optional(defaults to2048
), size of the tilemap imagetexture_padding
: optional(defaults to2
), size of the padding between frames in pixelborder_padding
: optional(defaults to0
), size of the padding on the outer edge of the packed image in pixel
Example:
{
"asset_patterns": [
"tiles/agents/*",
"tiles/effects/*",
"tiles/missiles/*",
"tiles/ship/spaceBuilding_00*",
"tiles/ship/spaceBuilding_01*"
],
"output_path": "assets/tilemap",
"format": "Png",
"size": 512,
"texture_padding": 2,
"border_padding": 2
}