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

@ -27,11 +27,21 @@ pub struct Equippable {
pub to_hit: Option<i32>,
}
#[derive(Deserialize, Debug)]
pub struct SpriteInfo {
pub id: String,
pub alt: Option<String>,
pub colour: Option<bool>,
pub x: Option<f32>,
pub y: Option<f32>,
pub alt_x: Option<f32>,
pub alt_y: Option<f32>,
}
#[derive(Deserialize, Debug)]
pub struct Renderable {
pub glyph: String,
pub sprite: Option<String>,
pub colour_sprite: Option<bool>,
pub sprite: Option<SpriteInfo>,
pub fg: String,
pub bg: String,
pub order: i32,