#How do you make `TextBundle` a fixed width with wrapping?

16 messages · Page 1 of 1 (latest)

random furnace
#

let's say I have a simple text as the following

commands.spawn_bundle(TextBundle::from_section("Something very very long", default());

how can I make it wrap at a fixed length?

worn bane
#

There's no public way to make single blocks auto format

#

but you can format it yourself like this

#

if you want auto wrapping, rustfmt has you by default in visual studio code

#

just check save on format in settings

random furnace
#

huh, but what if the text is dynamic?

#

like, isn't the whole point of a layout system to have things auto-wrap? like there's flexbox that's responsive and all that, but text can't wrap to fit its parent?

worn bane
#

it has a max_width setting which is 100 characters long

#

i'm not sure i understand your question

random furnace
#

I don't see a max_width on TextStyle or TextSection or TextBundle or any of the related types, and it doesn't seem to wrap based on the width of the max_width of its parent

worn bane
#

ah you're talking about text bundle SWEAT

#

it's 3am here i should sleep

#

i thought you meant wrapping in your editor

#

you probably wanna use some egui or something more sophisticated

random furnace
#

ah okay, I already have egui in my project so it'll be easy 😩

wet vessel