bevy/crates/bevy_ui/src/entity.rs

30 lines
786 B
Rust
Raw Normal View History

2020-04-06 21:20:53 +00:00
use super::Node;
2020-04-06 23:15:59 +00:00
use bevy_derive::EntityArchetype;
2020-05-03 19:35:07 +00:00
use bevy_render::{mesh::Mesh, Renderable};
use crate::{Rect, render::UI_PIPELINE_HANDLE, QUAD_HANDLE};
use bevy_asset::Handle;
2020-04-06 21:20:53 +00:00
2020-05-03 19:35:07 +00:00
#[derive(EntityArchetype)]
2020-04-06 21:20:53 +00:00
#[module(meta = false)]
pub struct UiEntity {
pub node: Node,
2020-05-03 00:56:30 +00:00
pub rect: Rect,
2020-05-03 19:35:07 +00:00
pub mesh: Handle<Mesh>, // TODO: maybe abstract this out
// pub renderable: Renderable,
2020-04-06 21:20:53 +00:00
}
2020-05-03 19:35:07 +00:00
impl Default for UiEntity {
fn default() -> Self {
UiEntity {
node: Default::default(),
rect: Default::default(),
mesh: QUAD_HANDLE,
// renderable: Renderable {
// pipelines: vec![
// UI_PIPELINE_HANDLE
// ],
// ..Default::default()
// }
}
}
}