mirror of
https://github.com/griffi-gh/hUI.git
synced 2024-11-25 00:18:41 -06:00
make arg mut
This commit is contained in:
parent
7884de5560
commit
dc3f89db37
|
@ -29,7 +29,7 @@ macro_rules! ui_main {
|
|||
/// Initializes glium renderer, `UiInstance`, and runs the event loop.
|
||||
pub fn ui<T>(
|
||||
mut init: impl FnMut(&mut UiInstance) -> T,
|
||||
mut draw: impl FnMut(&mut UiInstance, Vec2, &T),
|
||||
mut draw: impl FnMut(&mut UiInstance, Vec2, &mut T),
|
||||
name: &'static str
|
||||
) {
|
||||
kubi_logging::init();
|
||||
|
|
|
@ -16,8 +16,10 @@ mod boilerplate;
|
|||
|
||||
ui_main!(
|
||||
"hUI: Internal input test",
|
||||
init: |_| {},
|
||||
run: |ui, size, _| {
|
||||
init: |_| {
|
||||
0
|
||||
},
|
||||
run: |ui, size, n| {
|
||||
Container::default()
|
||||
.with_size(size!(100%))
|
||||
.with_align(Alignment::Center)
|
||||
|
@ -30,6 +32,7 @@ ui_main!(
|
|||
.into_interactable()
|
||||
.on_click(|| {
|
||||
println!("clicked");
|
||||
*n += 1;
|
||||
})
|
||||
.add_child(ui);
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue