mirror of
https://github.com/sinbad/StevesUEHelpers.git
synced 2025-02-23 17:45:23 +00:00
Add the option to change the speed of each line displayed
This commit is contained in:
parent
6d1df0f90c
commit
68e49d9e92
@ -60,7 +60,7 @@ FText UTypewriterTextWidget::GetText() const
|
||||
return FText();
|
||||
}
|
||||
|
||||
void UTypewriterTextWidget::PlayLine(const FText& InLine)
|
||||
void UTypewriterTextWidget::PlayLine(const FText& InLine, float Speed)
|
||||
{
|
||||
check(GetWorld());
|
||||
|
||||
@ -102,7 +102,7 @@ void UTypewriterTextWidget::PlayLine(const FText& InLine)
|
||||
FTimerDelegate Delegate;
|
||||
Delegate.BindUObject(this, &ThisClass::PlayNextLetter);
|
||||
|
||||
TimerManager.SetTimer(LetterTimer, Delegate, LetterPlayTime, true);
|
||||
TimerManager.SetTimer(LetterTimer, Delegate, LetterPlayTime/Speed, true);
|
||||
|
||||
SetVisibility(ESlateVisibility::SelfHitTestInvisible);
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ public:
|
||||
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "Typewriter")
|
||||
void PlayLine(const FText& InLine);
|
||||
void PlayLine(const FText& InLine, float Speed = 1.0f);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "Typewriter")
|
||||
void GetCurrentLine(FText& OutLine) const { OutLine = CurrentLine; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user