mirror of
https://github.com/griffi-gh/hUI.git
synced 2024-11-22 07:08:42 -06:00
prepare test
This commit is contained in:
parent
91c9af9fd5
commit
95b4c47fbd
|
@ -14,12 +14,11 @@ mod boilerplate;
|
||||||
ui_main!(
|
ui_main!(
|
||||||
"hUI: 9-Patch demo",
|
"hUI: 9-Patch demo",
|
||||||
init: |_| {
|
init: |_| {
|
||||||
Instant::now()
|
|
||||||
},
|
},
|
||||||
run: |ui, size, instant| {
|
run: |ui, size, _| {
|
||||||
let width_ratio = 0.5 + 0.5 * instant.elapsed().as_secs_f32().sin().powi(2);
|
|
||||||
Container::default()
|
Container::default()
|
||||||
.with_size(size!(width_ratio/, 100%))
|
.with_size(size!(100%))
|
||||||
.with_direction(Direction::Horizontal)
|
.with_direction(Direction::Horizontal)
|
||||||
.with_align(Alignment::Center)
|
.with_align(Alignment::Center)
|
||||||
.with_padding(5.)
|
.with_padding(5.)
|
||||||
|
@ -30,8 +29,7 @@ ui_main!(
|
||||||
FillRect::default()
|
FillRect::default()
|
||||||
.with_size(size!(300, 100))
|
.with_size(size!(300, 100))
|
||||||
.with_frame(frame_rect! {
|
.with_frame(frame_rect! {
|
||||||
color: color::DARK_RED,
|
color: color::RED
|
||||||
corner_radius: 8.
|
|
||||||
})
|
})
|
||||||
.add_child(ui);
|
.add_child(ui);
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue