Entity render structure
This commit is contained in:
+1
-9
@@ -1,19 +1,11 @@
|
||||
use osmium::entity::Component;
|
||||
|
||||
pub struct Velocity(pub i32);
|
||||
|
||||
impl Component for Velocity {
|
||||
fn tick(&mut self) {}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let mut engine = osmium::init();
|
||||
|
||||
engine.thread("Main.tick", || {});
|
||||
|
||||
let mut my_rect = engine.draw(|r| {
|
||||
let mut my_rect = engine.entity(|r| {
|
||||
// r.draw_rect(0, 0, 10, 10);
|
||||
});
|
||||
|
||||
my_rect.component(Velocity(10));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user