Gravzer333:
Hey all,
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
thanks in advance
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’:
Just bind it to an actor BP that will be placed in the scene:
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:
And there’s a function to get the string so far and pad it with spaces:
Bob’s your uncle: