// Fill out your copyright notice in the Description page of Project Settings. #include "SLoadingScreen.h" #include "Templates/SharedPointer.h" #include "Widgets/Text/STextBlock.h" void SLoadingScreen::Construct(const FArguments& InArgs) { LoadingTexture = LoadObject(nullptr, TEXT("Texture'/Game/Materials/Images/LoadingT.LoadingT'")); if (IsValid(LoadingTexture)) { Brush.SetResourceObject(LoadingTexture); Brush.ImageSize = FVector2D(800, 800); ChildSlot[ SNew(SOverlay) + SOverlay::Slot() .HAlign(HAlign_Fill) .VAlign(VAlign_Fill) [ SNew(SImage) .Image(&Brush) ] + SOverlay::Slot() .HAlign(HAlign_Fill) .VAlign(VAlign_Fill) [ SNew(STextBlock) .ShadowColorAndOpacity(FLinearColor::Black) .ColorAndOpacity(FLinearColor::White) .ShadowOffset(FIntPoint(-1, 1)) .Font(FSlateFontInfo(FPaths::ProjectContentDir() / TEXT("/Fonts/PT_Serif/PTSerif-Bold.ttf"), 40)) .Text(FText::FromString("This is a test")) ] ]; } else { ChildSlot[ SNew(SOverlay) + SOverlay::Slot() .HAlign(HAlign_Fill) .VAlign(VAlign_Fill) [ SNew(SImage) .ColorAndOpacity(FLinearColor(1, 0, 0, 0.5)) ] ]; } } void SLoadingScreen::Tick(const FGeometry& AllottedGeometry, const double InCurrentTime, const float InDeltaTime) { //Super::Tick(AllottedGeometry, InCurrentTime, InDeltaTime); //write your tick code here } SLoadingScreen::~SLoadingScreen() { }