-
Notifications
You must be signed in to change notification settings - Fork 459
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
Pre/Post Update and Draw signals should include elapsed #1836
Comments
Hm, this is unfortunately a breaking change... I think we had those signals before there was an |
As an intermiary non-breaking improvement, the dispatch of the preupdate could be moved to after calculation of FlxG.elapsed, so that at least preUpdate listeners could use that. |
That seems reasonable. |
@Gama11 can you think of any reason these lines can't be moved up to the beginning of the function, after the early exit? https://github.com/HaxeFlixel/flixel/blob/dev/flixel/FlxGame.hx#L725-L736 It's breaking if someone needed to use last frame's |
Why do you need |
If you can't come up with a reason why, then Joe's suggestion is good and I can make a quick PR. I wanted to make sure I wasn't overlooking anything. |
Go ahead. |
Clearing out 5.0.0 tasks, was this completed? I see preUpdate is called after FlxG.elapsed is set, we don't pass elapsed in draw calls, but do we want to pass it on pre/post update signals? I could go either way, honestly |
Gonna close this out, for pre/post update they can just use FlxG.elapsed, and draw calls shouldn't use elapsed to begin with. let me know if you have any concerns |
Pre/Post Update and Draw signals should include elapsed. This time will always be calculated by the time the calls are required, and this information is useful in many cases, such as doing late updates to physics.
It seems FlxG.elapsed could be used in most cases, but not in the case of preUpdate because elapsed isn't calculated until after preUpdate is dispatched.
If the value is passed instead, it would also make the listeners more flexible.
The text was updated successfully, but these errors were encountered: