From b59447f64482a8b01f25626fd6cbf891e601fd34 Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Mon, 19 Feb 2024 13:46:13 +0100 Subject: [PATCH] upd example --- hui-examples/examples/rounded.rs | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/hui-examples/examples/rounded.rs b/hui-examples/examples/rounded.rs index 46e2e3c..db98dbe 100644 --- a/hui-examples/examples/rounded.rs +++ b/hui-examples/examples/rounded.rs @@ -5,11 +5,10 @@ use winit::{ event_loop::{EventLoopBuilder, ControlFlow} }; use hui::{ - UiInstance, UiSize, element::{ - container::{Alignment, Container}, + container::{Alignment, Container, Sides}, text::Text - }, + }, UiInstance, UiSize }; use hui_glium::GliumUiRenderer; @@ -44,10 +43,20 @@ fn main() { background: Some(vec4(1., 0.1, 0.1, 1.)), corner_radius: Some(30.), elements: vec![ - Box::new(Text { - text: "You tried".into(), - text_size: 50, - color: vec4(1., 1., 1., 1.), + Box::new(Container { + padding: Sides::all(40.), + align: (Alignment::Center, Alignment::Center), + 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() }), ],