Fade out, do something, fade in
Closed this issue ยท 4 comments
Hi there,
is the following possible?
- fade out
- do something game related. For example hide/show some Nodes...
- fade back in
So it's like change_scene()
with null
or ignore
but split into two calls.
If not, would it be possible to implement?
Thanks in advance ๐
No, it is not possible with this version but it is possible to easily implement.
All you need to do is fade out and then after informed about fade out animation being finished, do your job, and then do fade in again.
If I'm not mistaken, it would be something like this:
func pause(fade_out_options: Options, general_options: GeneralOptions) -> void:
_set_in_transition()
_set_clickable(general_options.clickable)
_set_pattern(fade_out_options, general_options)
if _fade_out(fade_out_options.fade_speed):
await _animation_player.animation_finished
fade_out_finished.emit()
func resume(fade_in_options: Options, general_options: GeneralOptions) -> void:
_set_clickable(general_options.clickable)
_set_pattern(fade_in_options, general_options)
if _fade_in(fade_in_options.fade_speed):
await _animation_player.animation_finished
fade_in_finished.emit()
_set_out_transition()
_set_clickable(true)
So you write these functions in the scene_manager.gd
file and then call pause
function from your code, your function which is going to do some modifications on the scene, is listening to fade_out_finished
signal and when that signal emits, it runs your code and after everything is good, call resume and done.
This should work.
Thank you, I will gladly try this! ๐ I could create a merge request afterwards, if you're open to this. But I also understand if this is a feature you're not interested in.
No, It's fine. I'm actually open to new ideas for this addon because I'm out of ideas to be honest. ๐
Feature added and #22 merged.