use nalgebra_glm::Vec2;

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
pub enum SpriteTextAlignment {
    Left,
    Center,
    Right,
}

impl Default for SpriteTextAlignment {
    fn default() -> Self {
        Self::Left
    }
}

#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct SpriteText {
    pub text: String,
    pub position: Vec2,
    pub depth: f32,
    pub font_size: f32,
    pub color: [f32; 4],
    pub alignment: SpriteTextAlignment,
    pub dirty: bool,
}

impl Default for SpriteText {
    fn default() -> Self {
        Self {
            text: String::new(),
            position: Vec2::new(0.0, 0.0),
            depth: 0.0,
            font_size: 24.0,
            color: [1.0, 1.0, 1.0, 1.0],
            alignment: SpriteTextAlignment::Left,
            dirty: true,
        }
    }
}
