-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to manage fade out and in as independant operations along with more advanced fade_in_place() concept #12
Comments
I think that's possible. TBH I never personally used the On that note, I'm interested in your opinion: would an enum be more comfortable to use than two separate, complete "fade_in()" and "fade_out" functions? Don't worry about how it works internally, that's more of an implementation detail. What I'm asking is do you think this
is more comfortable than this?
Or is there any other reason for the enum option I'm not seeing? |
fade_in() and fade_out() is more straight forward, and less likely to make a mistake when programming. It also allows for cleaner document as you can state what options are honored. The only advantage of allowing it to be an option is:
So you don't take the hit of a double fade_out(). But it also makes the API less straight forward:
The rest of the code would have to live in the new scene's _ready() This of course assumes you allow it in change_scene/reload_scene(). However the first case (change_scene + fade_in only) is a useful case. But one can fix that by adding option { "skip_fade_out" : true }. i.e:
Not sure "NEITHER" as an option is useful, but I tend to be a completionist for code when a feature has no real cost. |
Perhaps I could add our internal Now that I think about it, the I agree that I'd consider making the
|
Okay, I've implemented this feature on Sorry it's a bit rushed, but I'm leaving on vacation for a couple of weeks and will most likely not be able to make changes for a while. I'll still try to be responsive here so let me know if there are any issues. |
Have fun on vacation. I may consider looking at writing a few more demos using these APIs in a good way. |
Merged the fixes you sent @mouring, they look good to me. |
Is your feature request related to a problem? Please describe.
I need to be able to independently control when to "fade out" and "fade in" occurs. My use case would be calling fade_in_place() to fade out, change the existing scene, and fade in. I don't trust that wait_time will be long enough to trust to do this via signal.
Describe the solution you'd like
I would like a new default_options:
Describe alternatives you've considered
The fade_direction option could be done with direct API call (how I implemented it originally). e.g. func scene_fade_in(options), func scene_fade_out(options). Which could call _get_final_options() and then the correct _fade_in(..)/_fade_out(..).
This is the code I'm currently using in my project. I suspect the enum {} should be in SceneManagerConstants.gd, but for the simplity I threw it all into SceneManager.gd.
The text was updated successfully, but these errors were encountered: