mirror of
https://github.com/griffi-gh/hUI.git
synced 2024-11-23 07:38:42 -06:00
35 lines
723 B
Rust
35 lines
723 B
Rust
use std::time::Instant;
|
|
use hui::{
|
|
color, element::{
|
|
container::Container,
|
|
fill_rect::FillRect,
|
|
UiElementExt
|
|
}, frame_rect, layout::{Alignment, Direction}, size
|
|
};
|
|
|
|
#[path = "../boilerplate.rs"]
|
|
#[macro_use]
|
|
mod boilerplate;
|
|
|
|
ui_main!(
|
|
"hUI: 9-Patch demo",
|
|
init: |_| {
|
|
|
|
},
|
|
run: |ui, size, _| {
|
|
Container::default()
|
|
.with_size(size!(100%))
|
|
.with_align(Alignment::Center)
|
|
.with_background(color::WHITE)
|
|
.with_children(|ui| {
|
|
FillRect::default()
|
|
.with_size(size!(300, 100))
|
|
.with_frame(frame_rect! {
|
|
color: color::RED
|
|
})
|
|
.add_child(ui);
|
|
})
|
|
.add_root(ui, size);
|
|
}
|
|
);
|