Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make tilemap respond to Anchor component. #596

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2ae34df
feature: Make tilemap respond to Anchor component.
shanecelis Feb 3, 2025
e75fcd4
style: Reformat.
shanecelis Feb 3, 2025
ea0a71a
bug: Only compile anchor example with "render".
shanecelis Feb 3, 2025
3a1fbfb
feature: Use TilemapAnchor, not sprite::Anchor.
shanecelis Feb 4, 2025
897d197
feature: Update all examples that use center.
shanecelis Feb 4, 2025
50f678f
style: Reformat.
shanecelis Feb 4, 2025
32235a5
refactor: Move non-generic code to helper.
shanecelis Feb 4, 2025
b822b67
doc: Document sparsely; add derives.
shanecelis Feb 4, 2025
3facd3b
feature: Register `TilemapAnchor` type.
shanecelis Feb 5, 2025
77cc2cb
style: Reformat.
shanecelis Feb 5, 2025
f85f198
refactor: Add anchor arg to `center_in_world()`.
shanecelis Feb 10, 2025
9c695cb
chore: Listen to clippy.
shanecelis Feb 10, 2025
5a925ba
style: Reformat.
shanecelis Feb 10, 2025
a93013d
refactor: Use Transform instead of += Vec2.
shanecelis Feb 10, 2025
9d539ff
refactor: Make as_offset() public.
shanecelis Feb 11, 2025
93db3f5
chore: Remove duplicate feature in Cargo.
shanecelis Feb 11, 2025
a80fa01
chore: Accept Clippy's new advice.
shanecelis Feb 23, 2025
8bdfd43
doc: Explain anchor offset better.
shanecelis Feb 26, 2025
94fd026
refactor: Require TilemapTileSize arg for 3 fns.
shanecelis Mar 4, 2025
2e68c93
feature: TAB changes grid size in hex_neighbors.
shanecelis Mar 4, 2025
808e717
style: Reformat.
shanecelis Mar 4, 2025
533a30d
feature: UI label and inst. in hex_neighbors.
shanecelis Mar 4, 2025
48483df
chore: Permit too many args in example.
shanecelis Mar 4, 2025
94e4587
refactor: Remove comment and named option.
shanecelis Mar 4, 2025
fe9fa3a
feature: Replace anchor.rs with hex_neighbors.
shanecelis Mar 8, 2025
d10dc7f
feature: Restore original hex_neighbors.
shanecelis Mar 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ features = [
"multi_threaded",
"default_font",
"webgl2",
"default_font",
"bevy_gizmos",
]

[target.'cfg(unix)'.dev-dependencies.bevy]
Expand All @@ -74,7 +74,7 @@ features = [
"multi_threaded",
"default_font",
"webgl2",
"default_font",
"bevy_gizmos",
]


Expand Down Expand Up @@ -198,3 +198,7 @@ required-features = ["render"]
name = "visibility"
path = "examples/visibility.rs"
required-features = ["render"]
[[example]]
name = "anchor"
path = "examples/anchor.rs"
required-features = ["render"]
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ A tilemap rendering plugin for [`bevy`](https://bevyengine.org/). It is more ECS
- GPU powered animations.
- Isometric and Hexagonal tile maps.
- Examples for integration with [Tiled](https://www.mapeditor.org/) and [LDTK](https://ldtk.io/) editors.
- Can `Anchor` tilemap like a sprite.

## Screenshots

Expand Down
2 changes: 1 addition & 1 deletion examples/accessing_tiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ fn startup(mut commands: Commands, asset_server: Res<AssetServer>) {
map_type,
texture: TilemapTexture::Single(texture_handle),
tile_size,
transform: get_tilemap_center_transform(&map_size, &grid_size, &map_type, 0.0),
anchor: TilemapAnchor::Center,
..Default::default()
},
LastUpdate(0.0),
Expand Down
Loading