so like the title suggests im trying to achieve something that seems to be in so many games these days but its something that I’m finding impossible to achieve
is there a way that i can print text letter by letter from left to right with the text centred in a text box?
now if the text box justification is set to centre then when the text prints, it will add characters and expand outwards left and right from the centre point but this isn’t what I’m after.
The desired result is that the text prints from left to right top to bottom but already in the centred alignment to the text box.
I have tried many many things these include
panning a material over the text like a loading bar to reveal it, this results in all lines revealing at the same time, not what I’m after
replace all text with spaces print all this in one go and then swap out the spaces for letters one by one, but i couldn’t get this to work
adjusting the margin per line, but this wont allow any text to be adaptable to any screen size and is not exposed to blueprints as far as I’m aware
changing the padding, while this kind of works I’m still stuck with all lines having left justification and not being truly centred
google searching till for about 5 hours straight to no avail
im currently using blueprints and the text is a rich text block for coloured highlight text reasons. I’m sure I’m missing something small, or maybe unreal just cant do this in blueprints, but any help will be most welcome
I think you may be giving yourself a hard time over nothing…
If it’s centered by the time the text is revealed, then the text must have been there the whole time, otherwise you’d have the speading out from the center effect.
I think your spaces for letters is the best option so far, followed closely by covering the text with another widget.
I’m gonna fiddle with the spaces concept and come back…
Ok - so it’s not particulary pretty, but it works. I just have a centered text box in the widget, you have to use a non-proportionally spaced font, I used ‘Droid sans mono’:
The BP actor contains the text in a string, and that will be split up by character and put in an array with space padding on the end. We then run though the array, gradually pulling out longer strings:
okay so ive given it a go and its all making sense, so far, I even managed to get coloured text semi working though it does jump about a tiny bit because of the rich text block needing ro rcognise at least a single character to change the colour with.
However, ive now run into the issue of multiple lines, it seems that when the string becomes too long and moves on to a new line theres a weird wrong start and a jump in too
not sure what to do to make that work but this is probably due to all those spaces being added it looks like, Ill keep experimenting in the mean time to see what i can do
THANKS SO MUCH FOR THE HELP BY THE WAY
really i dunno what i would have done without the help