improved sprites - spriteinfo and methods

This commit is contained in:
Llywelwyn 2023-09-26 20:40:17 +01:00
parent 849c400497
commit bd450e806b
12 changed files with 187 additions and 108 deletions

View file

@ -126,7 +126,7 @@ fn draw_bar(
let fill_width = (percent * (w as f32)) as i32;
for x in 0..w {
let suffix = if x == 0 { "1" } else if x == w - 1 { "3" } else { "2" };
let fill = if x <= fill_width { "full" } else { "empty" };
let fill = if x < fill_width { "full" } else { "empty" };
let sprite = if let Some(sprite) = atlas.get(&format!("{}_{}_{}", sprite, fill, suffix)) {
sprite
} else {