draw out of bounds as a darker colour
This commit is contained in:
parent
e43a422708
commit
bbe5ab0868
1 changed files with 4 additions and 2 deletions
|
@ -224,6 +224,8 @@ impl Board {
|
||||||
for y in start_y..(start_y + tile_height) {
|
for y in start_y..(start_y + tile_height) {
|
||||||
let tx = (x as isize + self.offset_x) as usize;
|
let tx = (x as isize + self.offset_x) as usize;
|
||||||
let ty = (y as isize + self.offset_y) as usize;
|
let ty = (y as isize + self.offset_y) as usize;
|
||||||
|
let px = x * tile_size + offset.x as i32;
|
||||||
|
let py = y * tile_size + offset.y as i32;
|
||||||
if self.in_bounds((tx, ty).into()) {
|
if self.in_bounds((tx, ty).into()) {
|
||||||
let tile = self.rows[ty][tx];
|
let tile = self.rows[ty][tx];
|
||||||
let texname = tile.texture();
|
let texname = tile.texture();
|
||||||
|
@ -231,9 +233,9 @@ impl Board {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
let texture = textures.get(&texname);
|
let texture = textures.get(&texname);
|
||||||
let px = x * tile_size + offset.x as i32;
|
|
||||||
let py = y * tile_size + offset.y as i32;
|
|
||||||
draw_scaled_texture(d, texture, px, py, (1 << zoom) as f32);
|
draw_scaled_texture(d, texture, px, py, (1 << zoom) as f32);
|
||||||
|
} else {
|
||||||
|
d.draw_rectangle(px, py, tile_size, tile_size, Color::new(0, 0, 0, 80));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue