mirror of
https://github.com/griffi-gh/hUI.git
synced 2024-11-21 22:58:42 -06:00
update example
This commit is contained in:
parent
ab5998de03
commit
2af4fd900c
|
@ -41,7 +41,11 @@ ui_main!(
|
|||
.with_wrap(true)
|
||||
.with_children(|ui| {
|
||||
Text::new(format!("Number of images: {counter}"))
|
||||
.with_text_size(24)
|
||||
.with_text_size(32)
|
||||
.add_child(ui);
|
||||
Br.add_child(ui);
|
||||
Text::new("Absolute tracking slider:")
|
||||
.with_text_size(16)
|
||||
.add_child(ui);
|
||||
Br.add_child(ui);
|
||||
Slider::new(*counter as f32 / 100.)
|
||||
|
@ -51,6 +55,18 @@ ui_main!(
|
|||
})
|
||||
.add_child(ui);
|
||||
Br.add_child(ui);
|
||||
Text::new("Relative tracking slider (Experimental):")
|
||||
.with_text_size(16)
|
||||
.add_child(ui);
|
||||
Br.add_child(ui);
|
||||
Slider::new(*counter as f32 / 100.)
|
||||
.with_size(size!(66%, 20))
|
||||
.with_follow_mode(hui::element::slider::SliderFollowMode::Relative)
|
||||
.on_change(|x| {
|
||||
CounterSignal::ChangeValue((x * 100.).round() as u32)
|
||||
})
|
||||
.add_child(ui);
|
||||
Br.add_child(ui);
|
||||
for _ in 0..*counter {
|
||||
Image::new(*image)
|
||||
.with_size(size!(48, 48))
|
||||
|
|
Loading…
Reference in a new issue