bevy_entitiles 0.4.0

A 2d tilemap library for bevy. With many useful algorithms/tools built in.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#define_import_path bevy_entitiles::isometric

#import bevy_entitiles::common::{VertexInput, tilemap}

fn get_mesh_origin(input: VertexInput) -> vec2<f32> {
    let index = vec2<f32>(input.index.xy) * tilemap.axis_dir;
    let flipped = (1. - tilemap.axis_dir) / 4.;
    
    return vec2<f32>(
        (index.x - index.y),
        (index.x + index.y)
    ) / 2. * tilemap.slot_size
    - (flipped.x + flipped.y) * vec2<f32>(0., tilemap.slot_size.y);
}