Skip to content

Commit 8c24432

Browse files
committed
docs: update
1 parent fe29e67 commit 8c24432

6 files changed

Lines changed: 15 additions & 16 deletions

File tree

docs/.vitepress/config.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default defineConfig({
4444
items: [
4545
{ text: 'PixelInfo', link: '/userdata/pixelinfo' },
4646
{ text: 'ColorInfo', link: '/userdata/colorinfo' },
47-
{ text: 'Anchor', link: '/userdata/anchor' },
47+
{ text: 'PlacerInfo', link: '/userdata/placerinfo' },
4848
],
4949
},
5050
{

docs/configuration/tileset.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,18 @@ I recommend defining this in a `tileset.lua` file which is contained in the tile
1515
- `name` - string
1616

1717
This has to be the same as the tileset's folder
18-
- `tile_size` - nil, positive number
18+
- `base_tile_size` - positive number (pixels)
1919

20-
For now, this is automatically inferred and doesn't need to be set. Stay tuned though!
20+
Informs wavewall of the "default", or 1x, tile size. Tiles are allowed to be integer multiples of this size.
21+
If you use multiple tile sizes, make sure that everything is actually an integer multiple! Gaps will appear
22+
in the output image otherwise.
2123

2224
::: details Example
2325
```lua
2426
tileset = {
2527
info = {
26-
name = "my_tileset"
28+
name = "my_tileset",
29+
base_tile_size = 100
2730
}
2831
}
2932
```
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
---
2-
title: Anchor
2+
title: PlacerInfo
33
---
44
# About
5-
`Anchor` is a table provided to a `placer` function. It has the following fields:
5+
`PlacerInfo` is a table provided to a `placer` function. It has the following fields:
66

77
- `x`: the x coordinate of the anchor
88
- `y`: the y coordinate of the anchor
9+
- `max_scale`: the max integer-multiple size the tile that `placer` returns is allowed to be, as compared to `tileset.info.base_tile_size`
910

1011
The coordinates are not in pixels; rather, they are in tile lengths. If we imagine an output image that can fit four tiles inside it, the anchors would look like this:
1112

src/config/tileset/info.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use mlua::{Table, Value};
66
#[derive(Debug)]
77
pub struct Info {
88
pub name: String,
9-
pub tile_size: usize,
9+
pub base_tile_size: usize,
1010
}
1111

1212
pub fn parse(input: Value, loc: &Location) -> Result<Info, AppError> {
@@ -24,11 +24,11 @@ pub fn parse(input: Value, loc: &Location) -> Result<Info, AppError> {
2424
}
2525

2626
fn parse_table(table: Table, loc: &Location) -> Result<Info, AppError> {
27-
opt_simple!(name, string_necessary, table, loc);
28-
opt_simple!(tile_size, uint_necessary, table, loc);
27+
opt_simple!(name, string_necessary, table, loc);
28+
opt_simple!(base_tile_size, uint_necessary, table, loc);
2929

3030
Ok(Info {
3131
name,
32-
tile_size
32+
base_tile_size
3333
})
3434
}

src/result/mod.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ pub struct ResultAnchors {
1818
image: Image,
1919
tile_size: i64,
2020
anchors: Vec<Anchor>,
21-
largest_anchor: Anchor
2221
}
2322

2423
pub struct ResultTiles {
@@ -57,13 +56,10 @@ impl ResultAnchors {
5756
info!("created {} anchors", anchors.len());
5857
debug!(?anchors);
5958

60-
let largest_anchor = anchors.last().unwrap().clone();
61-
6259
Self {
6360
image,
6461
tile_size,
6562
anchors,
66-
largest_anchor
6763
}
6864
}
6965

@@ -72,7 +68,6 @@ impl ResultAnchors {
7268
image,
7369
tile_size,
7470
anchors,
75-
largest_anchor
7671
} = self;
7772

7873
let mut rng = rand::rng();

src/runtime/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ impl Runtime {
8282
tileset,
8383
} = source;
8484

85-
let tile_size = tileset.info.tile_size;
85+
let tile_size = tileset.info.base_tile_size;
8686

8787
let recipe_name = match tileset.recipe {
8888
Some(recipe) => recipe,

0 commit comments

Comments
 (0)