But i have gotten a bit confused on how you would go about setting your own custom widget to display when loading the maps. I understand that it is this variable that should be set to the wanted widget, but i don’t really understand how i would convert a UserWidget that i have created to a SWidget.
/** The widget to be displayed on top of the movie or simply standalone if there is no movie. */
TSharedPtr<class SWidget> WidgetLoadingScreen;
So let me say this about UMG and Slate, UMG is UObject-compatible frontend of Slate, created to make Slate usable in blueprints (as all Slate classes are non-UObject and invisible to reflection system there for can’t be used in blueprints) and all UMG widgets (with prefix U) are containers for Slate widgets (with S prefix). So slate practiclly have same widgets… even more widgets them UMG has
To get underling SWidget of UMG widget you use this function:
Also alternatively you can easily construct Slate widgets, it really super easy which makes Slate very easy to use in C++, here examples:
But i understand you want to use UMG editor to declere Slate widgets insted ;]
I don’t mean to hijack the post, but I figured that I would be able to get get some pointers on getting my loading screen setup as you two seem to have it figured out.
Below are screens of my header and cpp file, but there seem to be some errors that I’m running into.
Yes I added MoviePlayer into my LostEchoes.Build.cs file.
My errors are pretty funky like “missing ;” but my whole game compiles and runs fine. Just that the red underlines never go away, and I don’t seem to have a load screen running when I start my game.
I’m curious what you did to get it working with your UMG widgets. I attempted to essentially get a UUserWidget to the SWidget needed and when debugging it has a valid object. However I then receive a Rendering Thread exception. It works with the base load screen from FLoadingScreenAttributes::NewTestLoadingScreenWidget(). The relevant part of my Game instance is below. the wLoading essentially is where the LoadingWidget is set and then it constantly gets casted or built into an SWidget to be placed inside the movie player loading screen.
Hello, thanks in advance for your code.
I referred to it, and I also met a rendering exception, not sure whether the same as you met, when I load map for the second time.
I also found LoadingWidget became unusable for the second time as I play in viewport, and that widget is destroyed on loading map.
Then I put LoadingWidget = CreateWidget(this, wLoading); in BeginLoadingScreen, and no crash occurs either in PlayInViewport or in Standalone. It works.
PS. My MoviePlayer only works in Standalone (screen stuck in PlayInViewport until map is loaded). Are yours the same?