//! Icons are world elements that have a specific size and cannot be stretched. They are usually used //! as markers for specific places in the world. use super::Component; use crate::math::{Rect, Vec2}; use serde::{Deserialize, Serialize}; /// The icon datatype. #[derive(Clone, Debug, Serialize, Deserialize)] pub struct Icon { /// The id of the icon is the icons position in the currently loaded icon_data vector. pub id: usize, /// The position of the icon on the map, given by the vector in meters. pub position: Vec2, /// Rotation of the icon texture in degrees. pub rotation: f64, } impl Component for Icon { fn bounding_rect(&self) -> Rect { Rect::new(self.position.x, self.position.y, 0., 0.) } }