From cc8734e793aa7018042657ab91560f3f7b7dca0f Mon Sep 17 00:00:00 2001 From: hut Date: Tue, 19 Mar 2024 15:51:08 +0100 Subject: [PATCH] added text wrapping --- src/hud.rs | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/src/hud.rs b/src/hud.rs index 50f38e0..7f4aa71 100644 --- a/src/hud.rs +++ b/src/hud.rs @@ -237,16 +237,31 @@ fn setup( ), ]).with_style(Style { position_type: PositionType::Absolute, - bottom: Val::VMin(2.0), - left: Val::VMin(4.0), + bottom: Val::VMin(0.0), + left: Val::VMin(0.0), //bottom: Val::VMin(40.0), //left: Val::VMin(30.0), ..default() }).with_text_justify(JustifyText::Left); commands.spawn(( - bundle_chatbox, - ChatText, - )); + NodeBundle { + border_color: { BorderColor(Color::RED) }, + style: Style { + width: Val::Percent(50.), + align_items: AlignItems::Start, + position_type: PositionType::Absolute, + bottom: Val::VMin(10.0), + left: Val::VMin(25.0), + ..default() + }, + ..default() + }, + )).with_children(|parent| { + parent.spawn(( + bundle_chatbox, + ChatText, + )); + }); } fn update(