Hi.
(I am tipping my toes into unreal for the first time, so sorry if this is a noob question.)
For one of the custom user widgets I am trying to develop in C++ I would need a parameter of type FSlateFontInfo that carries a default value in a method - something like:
UFUNCTION(BlueprintCallable, Category = “DemoCategory”)
void SomeMethodName(
FSlateFontInfo TitleFont = ???)
For types like FVector2D, FLinearColor or EHorizontalAlignment I got it done. But Somehow when I add a default value for FSlateFontInfo, my project does not build anymore. I get the error
|Error||C++ Default parameter not parsed: TitleFont
I tried the following possibilities to initialize my TitleFont:
= FSlateFontInfo(FCoreStyle::GetDefaultFont(), 12);
and
= FCoreStyle::Get().GetFontStyle(TEXT(“NormalText”));
besides my own .generated.h my .h file contains all of these includes I added for this test and other tests:
include “CoreMinimal.h”
include “Blueprint/UserWidget.h”
include “Math/Vector2D.h”
include “UObject/ConstructorHelpers.h”
include “Fonts/SlateFontInfo.h”
include “Styling/CoreStyle.h”
include “Styling/AppStyle.h”
Or could it be I am missing a module in my build file?
PublicDependencyModuleNames.AddRange(new string { “Core”, “CoreUObject”, “Engine”, “InputCore”, “UMG” });
PrivateDependencyModuleNames.AddRange(new string { “Slate”, “SlateCore” });
Do you maybe have an advice for me?