mirror of
https://github.com/griffi-gh/hUI.git
synced 2024-11-21 22:58:42 -06:00
upd example
This commit is contained in:
parent
36947bff94
commit
b59447f644
|
@ -5,11 +5,10 @@ use winit::{
|
||||||
event_loop::{EventLoopBuilder, ControlFlow}
|
event_loop::{EventLoopBuilder, ControlFlow}
|
||||||
};
|
};
|
||||||
use hui::{
|
use hui::{
|
||||||
UiInstance, UiSize,
|
|
||||||
element::{
|
element::{
|
||||||
container::{Alignment, Container},
|
container::{Alignment, Container, Sides},
|
||||||
text::Text
|
text::Text
|
||||||
},
|
}, UiInstance, UiSize
|
||||||
};
|
};
|
||||||
use hui_glium::GliumUiRenderer;
|
use hui_glium::GliumUiRenderer;
|
||||||
|
|
||||||
|
@ -44,10 +43,20 @@ fn main() {
|
||||||
background: Some(vec4(1., 0.1, 0.1, 1.)),
|
background: Some(vec4(1., 0.1, 0.1, 1.)),
|
||||||
corner_radius: Some(30.),
|
corner_radius: Some(30.),
|
||||||
elements: vec![
|
elements: vec![
|
||||||
Box::new(Text {
|
Box::new(Container {
|
||||||
text: "You tried".into(),
|
padding: Sides::all(40.),
|
||||||
text_size: 50,
|
align: (Alignment::Center, Alignment::Center),
|
||||||
color: vec4(1., 1., 1., 1.),
|
size: (UiSize::Auto, UiSize::Auto),
|
||||||
|
background: Some(vec4(0.1, 0.1, 0.1, 0.5)),
|
||||||
|
corner_radius: Some(30.),
|
||||||
|
elements: vec![
|
||||||
|
Box::new(Text {
|
||||||
|
text: "You tried".into(),
|
||||||
|
text_size: 50,
|
||||||
|
color: vec4(1., 1., 1., 1.),
|
||||||
|
..Default::default()
|
||||||
|
}),
|
||||||
|
],
|
||||||
..Default::default()
|
..Default::default()
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
|
|
Loading…
Reference in a new issue