#include <FramesPerSecondWidget.h>
◆ Initialize()
| bool UFramesPerSecondWidget::Initialize |
( |
| ) |
|
|
overrideprotectedvirtual |
11{
12 const bool Success = Super::Initialize();
15 return true;
16}
◆ NativeConstruct()
| void UFramesPerSecondWidget::NativeConstruct |
( |
| ) |
|
|
overrideprotectedvirtual |
19{
20 Super::NativeConstruct();
21 if(GetWorld() != nullptr && GetOwningPlayer() != nullptr)
22 {
24 }
25}
◆ UpdateFPS()
| void UFramesPerSecondWidget::UpdateFPS |
( |
| ) |
const |
|
private |
28{
29 const float WorldTime = UGameplayStatics::GetWorldDeltaSeconds(GetOwningPlayer());
30 const int32 FramesPerSecond = UKismetMathLibrary::FTrunc((1.0f / WorldTime));
31 FramesTextBlock->SetText(FText::FromString(FString::FromInt(FramesPerSecond)));
32}
◆ FramesTextBlock
| class UTextBlock* UFramesPerSecondWidget::FramesTextBlock |
|
protected |
◆ UpdateSpeed
| float UFramesPerSecondWidget::UpdateSpeed = 1.0f |
|
protected |
◆ UpdateSpeedTimer
| FTimerHandle UFramesPerSecondWidget::UpdateSpeedTimer |
|
private |
The documentation for this class was generated from the following files:
- T:/Unreal/Unreal Projects/SpaceAdventure52/SpaceAdventure/Plugins/BaseHelpers/Source/BaseHelpers/Public/Widgets/FramesPerSecondWidget.h
- T:/Unreal/Unreal Projects/SpaceAdventure52/SpaceAdventure/Plugins/BaseHelpers/Source/BaseHelpers/Private/Widgets/FramesPerSecondWidget.cpp