draw queue
This commit is contained in:
parent
3b026c73cd
commit
2447e60f16
6 changed files with 90 additions and 41 deletions
|
|
@ -1,8 +1,26 @@
|
|||
use bevy::prelude::*;
|
||||
use bevy_ratatui::RatatuiContext;
|
||||
use ratatui::Frame;
|
||||
|
||||
pub(crate) mod hand;
|
||||
pub(crate) mod ingame;
|
||||
pub(crate) mod menu;
|
||||
pub(crate) mod tile;
|
||||
|
||||
#[derive(Resource, Default)]
|
||||
pub(crate) struct WidgetStack(pub(crate) Vec<Box<dyn FnOnce(&mut Frame) + Send + Sync>>);
|
||||
|
||||
#[derive(Component)]
|
||||
pub(crate) struct Hovered;
|
||||
|
||||
pub(crate) fn draw_system(
|
||||
mut tui_ctx: ResMut<RatatuiContext>,
|
||||
mut widgetstack: ResMut<WidgetStack>,
|
||||
) -> Result {
|
||||
tui_ctx.draw(|frame| {
|
||||
for widget in widgetstack.0.drain(..) {
|
||||
widget(frame)
|
||||
}
|
||||
})?;
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue