LoadSensePro provides multiple flexible approaches to integrate your custom loading screen widgets. This guide covers all integration methods, from simple drag-and-drop solutions to advanced custom implementations.
LoadSensePro’s widget system is designed with flexibility in mind. You can:
UWBP_LoadingScreen as a base classILoadingScreenInterface for maximum controlThe most robust approach is implementing ILoadingScreenInterface in your custom widget.
// Copyright Seven-Mountains-Labs, Tim Koepsel - 2024 All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Blueprint/UserWidget.h"
#include "Interface/LoadingScreenInterface.h"
#include "MyCustomLoadingWidget.generated.h"
UCLASS()
class YOURGAME_API UMyCustomLoadingWidget : public UUserWidget, public ILoadingScreenInterface
{
GENERATED_BODY()
public:
// ILoadingScreenInterface implementation
virtual void SetBackgroundImage_Implementation(UTexture2D* NewTexture) override;
virtual void SetLoadingProgress_Implementation(float Progress) override;
virtual void SetLoadingText_Implementation(const FString& StatusText) override;
protected:
UPROPERTY(meta = (BindWidget))
class UImage* BackgroundImage;
UPROPERTY(meta = (BindWidget))
class UProgressBar* LoadingProgressBar;
UPROPERTY(meta = (BindWidget))
class UTextBlock* LoadingText;
};
// Copyright Seven-Mountains-Labs, Tim Koepsel - 2024 All Rights Reserved.
#include "MyCustomLoadingWidget.h"
#include "Components/Image.h"
#include "Components/ProgressBar.h"
#include "Components/TextBlock.h"
void UMyCustomLoadingWidget::SetBackgroundImage_Implementation(UTexture2D* NewTexture)
{
if (BackgroundImage && NewTexture)
{
BackgroundImage->SetBrushFromTexture(NewTexture);
}
}
void UMyCustomLoadingWidget::SetLoadingProgress_Implementation(float Progress)
{
if (LoadingProgressBar)
{
LoadingProgressBar->SetPercent(FMath::Clamp(Progress, 0.0f, 1.0f));
}
}
void UMyCustomLoadingWidget::SetLoadingText_Implementation(const FString& StatusText)
{
if (LoadingText)
{
LoadingText->SetText(FText::FromString(StatusText));
}
}
For maximum compatibility and features, inherit from the provided base class:
// Copyright Seven-Mountains-Labs, Tim Koepsel - 2024 All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "UI/WBP_LoadingScreen.h"
#include "MyAdvancedLoadingWidget.generated.h"
UCLASS()
class YOURGAME_API UMyAdvancedLoadingWidget : public UWBP_LoadingScreen
{
GENERATED_BODY()
public:
// Override for custom behavior
virtual void UpdateProgressBar(float Progress) override;
virtual void UpdateStatusText(const FString& NewText) override;
// Add your custom functions
UFUNCTION(BlueprintCallable, Category = "Custom Loading")
void PlayCustomAnimation();
protected:
virtual void NativeConstruct() override;
// Your custom widgets
UPROPERTY(meta = (BindWidget))
class UWidget* CustomAnimationWidget;
};
For quick integration without code changes, use standardized widget names:
LoadSensePro automatically detects these widgets using GetWidgetFromName().
Create a ULoadingScreenDataAsset and configure your custom widget:
// In your DataAsset
LoadingScreenWidgetClass = UMyCustomLoadingWidget::StaticClass();
MapName = "YourTargetMap";
LoadType = EMapLoadType::Asynchronous;
// Complete configuration example
LoadingImages = { Texture1, Texture2, Texture3 };
ImageSwitchTime = 5.0f;
MusicConfig = YourMusicConfigAsset;
If using Blueprint widgets, implement these interface events:
Create a Blueprint widget with these exact node names:
// Copyright Seven-Mountains-Labs, Tim Koepsel - 2024 All Rights Reserved.
void UMyAdvancedLoadingWidget::UpdateProgressBar(float Progress)
{
// Call parent implementation
Super::UpdateProgressBar(Progress);
// Add custom animation logic
if (Progress >= 0.5f && !bHalfwayAnimationPlayed)
{
PlayCustomAnimation();
bHalfwayAnimationPlayed = true;
}
}
void UMyAdvancedLoadingWidget::PlayCustomAnimation()
{
// Your custom animation logic
if (CustomAnimationWidget)
{
// Trigger animation blueprint or play widget animation
}
}
LoadSensePro supports material-based image transitions:
// In your widget implementation
void UMyCustomLoadingWidget::InitializeFadeSystem()
{
UMaterial* FadeMaterial = LoadObject<UMaterial>(nullptr,
TEXT("/Game/Materials/M_ImageFade"));
if (FadeMaterial && BackgroundImage)
{
BackgroundMaterialInstance = UMaterialInstanceDynamic::Create(FadeMaterial, this);
BackgroundImage->SetBrushFromMaterial(BackgroundMaterialInstance);
}
}
LoadSensePro includes automatic widget validation:
// Automatic fallback hierarchy
1. Direct cast to your widget class
2. Interface method calls
3. Widget name lookup
4. Graceful degradation
Enable detailed logging for integration debugging:
// In your custom widget
DEFINE_LOG_CATEGORY_STATIC(LogCustomLoading, Log, All);
void UMyCustomLoadingWidget::SetBackgroundImage_Implementation(UTexture2D* NewTexture)
{
UE_LOG(LogCustomLoading, Log, TEXT("Setting background image: %s"),
NewTexture ? *NewTexture->GetName() : TEXT("NULL"));
// Implementation...
}
NativeConstruct()BeginDestroy()TObjectPtr for UE5 compatibilityWidget not updating:
BindWidget meta tag is used correctlyBackground images not switching:
ImageSwitchTime is greater than 0LoadingImages array is populated in DataAssetProgress not displaying:
SetPercent() is called on correct widgetEnable verbose logging:
// In DefaultEngine.ini
[Core.Log]
LogLoadingScreen=VeryVerbose
LogCustomLoading=VeryVerbose
Use development console commands:
LoadSensePro.ShowDebugInfo 1
LoadSensePro.LogWidgetHierarchy 1
See the complete example in the LoadSensePro samples folder:
/Content/LoadSensePro/Examples/WBP_MinimalCustom/Source/LoadSensePro/Examples/Reference implementation with animations and custom logic:
/Content/LoadSensePro/Examples/WBP_AdvancedCustom// ILoadingScreenInterface
UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
void SetBackgroundImage(UTexture2D* NewTexture);
UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
void SetLoadingProgress(float Progress);
UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
void SetLoadingText(const FString& StatusText);
// Usage in your game code
ULoadingScreenSubsystem* LoadingSystem =
GetGameInstance()->GetSubsystem<ULoadingScreenSubsystem>();
// Load with custom widget
LoadingSystem->LoadMapWithScreen("YourMap", UMyCustomLoadingWidget::StaticClass());
// Load with DataAsset
LoadingSystem->LoadMapByDataAsset(YourCustomDataAsset);
Need Help? Join our Discord Community for support and examples.