What name is needed for loading a Slate widget style?

For a simple menu with Slate I created a widget style in C++ code, following this tutorial.
Everything is going fine until I try to apply the style by starting up the game from inside the editor. In the line

MenuStyle = &FMenuStyles::Get().GetWidgetStyle<FGlobalStyle>("Global");

I am trying to get this style and pass it to the menu elements, but the editor is giving me a warning like this:

Unable to find Slate Widget 'Global'. Using FGlobalStyle defaults instead.

I tried to replace ‘Global’ with the full reference (SlateWidgetStyleAsset’/Game/UI/Global.Global’) but the warning remained the same. Do I have to pass its name in a different way? Or am I missing something?

The answer depends on how your style is set-up.

Could you post the line that creates your FSlateGameResources instance for FMenuStyles?

Thanks.

Thank you very much, there was my problem:

FSlateGameResources::New(FMenuStyles::GetStyleSetName(), “/Game/UI/Styles”, “/Game/UI/Styles”);

Unfortunately I had placed the asset in “/Game/UI” and forgot to create the sub folder “Styles”.

Thank you again for pointing me in the right direction :slight_smile: