event work + mulling over sprite containers and event notification

This commit is contained in:
2020-07-31 23:39:25 -07:00
parent 55899f26ad
commit 8da810f23a
10 changed files with 149 additions and 75 deletions

View File

@@ -11,7 +11,7 @@ use winit::event::Event;
/// Trait which may be inherited by objects that wish to be drawn to the screen
pub trait Drawable {
fn get(&self) -> VertexTypes;
fn get(&self) -> Vec<VertexTypes>;
}
/// Trait which may be inherited by objects that wish to receive events
@@ -29,7 +29,7 @@ impl CanvasFrame {
/// Push this drawable onto the back of the accumulator
pub fn draw(&mut self, drawable: &dyn Drawable) {
self.map.push(drawable.get());
drawable.get().iter().map(|x| {self.map.push(x.clone())});
}
}