use lotus_proc_macros::Component;
use super::super::{
managers::render::manager::Vertex,
super::ColorOption,
shape::{geometry_type::GeometryType, orientation::Orientation}
};
#[derive(Clone, Debug, Component)]
pub struct Sprite {
pub path: String,
pub vertices: Vec<Vertex>,
pub indices: Vec<u16>
}
impl Sprite {
pub fn new(path: String) -> Self {
let vertices: Vec<Vertex> = GeometryType::Square.to_vertex_array(Orientation::Horizontal, ColorOption::White.to_rgba());
let indices: Vec<u16> = GeometryType::Square.to_index_array();
let sprite: Sprite = Self {
path,
vertices,
indices
};
return sprite;
}
}