pause and unpause FlxTypedTexts

This commit is contained in:
2023-09-24 18:04:09 -06:00
parent 54c25d4d2b
commit be9de9c5e5
2 changed files with 12 additions and 0 deletions

View File

@@ -23,6 +23,7 @@ import hollywoo.HFloat;
import hollywoo_flixel.FlxMovie;
import flixel.util.FlxColor;
import flixel.text.FlxText;
import flixel.addons.text.FlxTypeText;
import flixel.system.FlxSound;
import flixel.FlxCamera;
import flixel.util.FlxTimer;

View File

@@ -78,6 +78,12 @@
(FlxG.state.forEach
->:Void child
(typeCase [child]
([:FlxTypeText typeText]
(when typeText.sounds
(doFor sound typeText.sounds
(when sound.playing
(sound.pause))))
(set typeText.paused true))
([:FlxSprite sprite]
(sprite.animation?.pause))
(otherwise))
@@ -102,6 +108,11 @@
(FlxG.state.forEach
->:Void child
(typeCase [child]
([:FlxTypeText typeText]
(when typeText.sounds
(doFor sound typeText.sounds
(when sound.playing (sound.resume))))
(set typeText.paused false))
([:FlxSprite sprite]
(sprite.animation?.resume))
(otherwise))