Something went wrong. Try again.
Hexagonal coordinate utilities for the Bevy game engine. crates.io/crates/bevy_hex_coords
Something went wrong. Try again.
Files
Verified signature Signed by isaaccorbrey.com SHA256:mwogCTZEXIXrYk4l7PaavTNPxe1Xqjf5jMIBe0LvAHU Click to copy SHA
Verified signature Signed by isaaccorbrey.com SHA256:mwogCTZEXIXrYk4l7PaavTNPxe1Xqjf5jMIBe0LvAHU Click to copy SHA
main Default
- Rust 100%
README.md
bevy_hex_coords #
A library that provides hexagonal coordinate utilities, with accurate vertex
and edge placement and rotation, for the Bevy game engine.
Warning
Not for production use. This library was built as a learning experience
in deriving hexagonal grid semantics from first principles. No thought has
been put into ergonomics and there is no guarantee that I will maintain this
in the future.
Installation #
cargo add bevy_hex_coords
Usage #
use bevy::prelude::*;
use bevy_hex_coords::prelude::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugins(HexCoordsPlugin {
auto_attach_transforms: true,
})
.add_systems(Startup, setup)
.run();
}
fn setup(mut commands: Commands) {
commands.spawn((
HexCoord::new(0, 0),
HexUnitSize(32.0),
Sprite::default(),
));
}
Example #
To see a demo of this library in action, run the following:
cargo run --example layout

License #
bevy_hex_coords is distributed under one of MIT or Apache-2.0.