// allows components to be drawn on the map
allows components to be drawn on the map
allows components to be drawn on the map
pub fn mapped_component(
  mut comps: Query<(&mut Transform, &TilePos, &TileParent), (With<DrawOnMap>, Changed<TilePos>)>,
  mut map: bevy_ecs_tilemap::MapQuery,
) {
  for (mut transform, position, parent) in comps.iter_mut() {
    let (_, layer) = map.get_layer(parent.map_id, parent.layer_id).unwrap();
    let t_s_width = layer.settings.tile_size.0;
    let t_s_height = layer.settings.tile_size.1;
    let d_tx = (t_s_width / 2.) + t_s_width * position.0 as f32;
    let d_ty = (t_s_height / 2.) + t_s_height * position.1 as f32;
    transform.translation = Vec3::new(d_tx, d_ty, 5.);
  }
}
pub fn mapped_component ( mut comps : Query < ( & mut Transform , & TilePos , & TileParent ) , ( With < DrawOnMap > , Changed < TilePos > ) > , mut map : bevy_ecs_tilemap :: MapQuery , ) { for ( mut transform , position , parent ) in comps . iter_mut ( ) { let ( _ , layer ) = map . get_layer ( parent . map_id , parent . layer_id ) . unwrap ( ) ; let t_s_width = layer . settings . tile_size . 0 ; let t_s_height = layer . settings . tile_size . 1 ; let d_tx = ( t_s_width / 2. ) + t_s_width * position . 0 as f32 ; let d_ty = ( t_s_height / 2. ) + t_s_height * position . 1 as f32 ; transform . translation = Vec3 :: new ( d_tx , d_ty , 5. ) ; } }
allows components to be drawn on the map
allows components to be drawn on the map
comps
Query<(&mut Transform, &TilePos, &TileParent), (With<DrawOnMap>, Changed<TilePos>)>
map
bevy_ecs_tilemap::MapQuery