FText Line Separating

Hello, I am trying to set two differente values to appear under one UTextRenderComponent, So to do so I’ve created a FText Variable that holds the text that I would be puting in the SetText Function for the Component, However… it says that it needs -br- to break line, I’ve tried br or \n but none of them seem to work, I’m not quite sure how to pass both values with that breakline in between. Any Examples are more than welcome.

You need to do it this way :

“This is my first line < br > This is my second line”

Do not forget to remove the space between after the < and before the >. This is HTML syntax is also used on AnswerHub to skip a line!

There for example:
just used a < br >!
and another one!

Mick

Thank you for the quick response Mick! However the problem I’m having is for example the following :

FText ObjectNameAndPrice = ObjectName< br >ObjectPrice;
TextRenderComponet->SetText(ObjectNameAndPrice);

So I am trying to fit a break line in between the two variables w/o altering them so I can have the name above and the price below.

What you are looking for then is formating. You < br > need to be part of the string, it is not an operator like you seem to be trying to do.

Here is an example :

FString objectName = TEXT("AnObjectName");
float objectPrice = 100.0f;
FString stringText = FString::Printf(TEXT("My Object Name: %s < br > My Object Price : %f"), *objectName, objectPrice);
FText myText = FText::FromString(stringText);

Thank you very much for yet again a quick response, I will be trying this out and will reply with the outcome !
Cheers!

It Worked! Although I was hoping to squeez the FString::SanitizeFloat so it would look more representable! Regardless it works so Thanks very much Mick! Posting as resolve!

Fixed it, just needed to add *before making it a FString for the SanitizeFloat! so it works like a charm! Thanks again!