it was z-stackinggit add .; git status duhgit add .; git status

bevy0.12
Elijah C. Voigt 2 years ago
parent 38b796ad31
commit 61ce668383

@ -232,17 +232,27 @@ fn set_tile_sprite(
/// Sets a piece location given it's board index
fn set_transform(
mut events: Query<
(&mut Transform, &BoardIndex),
(&mut Transform, &BoardIndex, Option<&Piece>, Option<&Tile>),
(
With<Display2d>,
Or<(Changed<BoardIndex>, Added<BoardIndex>)>,
),
>,
) {
events.iter_mut().for_each(|(mut t, i)| {
events.iter_mut().for_each(|(mut t, i, piece, tile)| {
let x = SCALE * 16.0 * ((i.x as f32) - 3.5);
let y = SCALE * 16.0 * ((i.y as f32) - 1.5);
*t = Transform::from_scale(Vec3::splat(SCALE)).with_translation(Vec3::new(x, y, 0.0));
let z = match (piece, tile) {
(None, None) | (Some(_), Some(_)) => {
error!("Entity with BoardIndex is neither a Piece nor a Tile!");
0.0
}
// Piece
(Some(_), None) => 2.0,
// Tile
(None, Some(_)) => 1.0,
};
*t = Transform::from_scale(Vec3::splat(SCALE)).with_translation(Vec3::new(x, y, z));
debug!("setting position of {:?} to {:?}", i, t);
});
}

@ -189,7 +189,7 @@ fn hydrate_camera(
hdr: true,
..default()
},
transform: Transform::from_xyz(0.0, 20.0, 10.0).looking_at(Vec3::ZERO, Vec3::Y),
transform: Transform::from_xyz(0.0, 12.5, 6.0).looking_at(Vec3::ZERO, Vec3::Y),
dither: DebandDither::Enabled,
color_grading: ColorGrading { ..default() },
..default()

Loading…
Cancel
Save