How to deal with dynamic text wrapping?

Hi.

I was wondering how one would deal with dynamic text wrapping. Say I have a chat box with a width of 550 pixels. Each time I commit a message a widget containing ChatChannel, PlayerName and Message information with be created and added to the chat box. It will look like this:
[ChannelName] [PlayerName]: Message…

Now I’ve been playing around with wrapping. I have the “Wrap Text At” Value at 400. And it looks good, however, depending character length on the ChannelName and PlayerName texts the message will have less room and therefor the value of 400 no longer works.

I’ve been trying to change that value dynamically through blueprints, but sadly that is not possible as you can only call Get value.

Is there any alternative solution to this issue?

Put the value Wrap Text At to zero and put as parent a size box with the length you want

Yeah I tried this. Doesn’t seem to change anything. I’ll give it another go

umm, check all alignments

Man what the hell… Tried the alignments. Still no difference. Gonna try some settings in parent.

Alright. I finally made it work. For whatever reason, writing a text like you do in your screenshot. The text wouldn’t create newlines and would instead keep going on one line. I made it work by simply deleting the “Text” Widget and Adding in a new one.

I do want to note that this seems incredible buggy, cuz If I write a message and then turn AutoWrap off and then on again, the results will be different and I will have to delete and create a new one again. Very weird.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.