Dear Friends at Epic,
#Repro
Try printing something like this using CanvasTextItem:
DayCount = FText::Format(NSLOCTEXT(“Solus”,“Solus”,"Day "), FText::AsNumber(1));
drawing to screen:
USolusCore::DrawJoyText(
Canvas,
Font,
DayCount,
Blue,
Origin.X, YOffset,
Scale,
false//Outline
);
my function
static FORCEINLINE void DrawJoyText(
FCanvas* Canvas,
UFont* TheFont,
const FText& TheText,
const FLinearColor& TheColor,
const float& X, const float& Y,
const float& TheScale,
bool DrawOutline=false,
const FLinearColor OutlineColor=FLinearColor(0,0,0,1)
) {
if(!Canvas) return;
//~~~~~~~~~
//Text and Font
FCanvasTextItem NewText(
FVector2D(X,Y),
TheText,
TheFont,
TheColor
);
//Text Scale
NewText.Scale.Set(TheScale,TheScale);
//Outline gets its alpha from the main color
NewText.bOutlined = DrawOutline;
NewText.OutlineColor = OutlineColor;
//Draw
Canvas->DrawItem(NewText);
}
#Issue
Only the NSLOCTEXT prints to screen
but if I just use the number by itself, it prints fine:
DayCount = FText::AsNumber(1);
#Request
Please investigate my usage case above and see why the number is not showing up when used with FText::Format
DayCount = FText::Format(NSLOCTEXT("Solus","Solus","Day "), FText::AsNumber(1));