Skip to content

icorbrey/bevy_hex_coords

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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::*;

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.

About

No description, website, or topics provided.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages