pause and resume animations

This commit is contained in:
2023-05-12 10:48:51 -06:00
parent 165536e6bc
commit bced4a0693

View File

@@ -31,6 +31,13 @@
(method :Void pause [] (method :Void pause []
(FlxG.inputs.remove actionManager) (FlxG.inputs.remove actionManager)
(FlxG.state.forEach
->:Void child
(typeCase [child]
([:FlxSprite sprite]
(sprite.animation?.pause))
(otherwise))
true)
(doFor sound currentSounds (doFor sound currentSounds
(sound.pause)) (sound.pause))
(doFor track currentVoiceTracks (doFor track currentVoiceTracks
@@ -46,6 +53,13 @@
(method :Void resume [] (method :Void resume []
(FlxG.inputs.add actionManager) (FlxG.inputs.add actionManager)
(FlxG.state.forEach
->:Void child
(typeCase [child]
([:FlxSprite sprite]
(sprite.animation?.resume))
(otherwise))
true)
(resumeAndUpdateCurrentVolume currentSounds soundVolume) (resumeAndUpdateCurrentVolume currentSounds soundVolume)
(resumeAndUpdateCurrentVolume currentVoiceTracks voiceVolume) (resumeAndUpdateCurrentVolume currentVoiceTracks voiceVolume)
(when music (when music